• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 6348
0%
main: 93%

Build:
Build:
LAST BUILD BRANCH: add/source-field-in-rust
DEFAULT BRANCH: main
Ran 21 Aug 2015 07:19PM UTC
Jobs 10
Files 354
Run time 12min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
6348

push

travis-ci

jsirois
Initial support for Go BUILD gen.

This adds support for both dynamically discovering and injecting
Go targets into the in-memory BuildGraph as well as adding support
for materializing BUILD files for those targets to disk.

The target creation scope can optionally include direct remote
dependencies, but otherwise defaults to only handling local source
targets.

Additionally, a simple templating system is provided to allow for
BUILD materialization that suits the local BUILD style.

To support some of the BUILD gen calculations and keep path calculation
code DRY, utilities are moved into the go target hierarchy.

Auto re-gen Go BUILD files in the repo with:
`./pants buildgen.go --remote --materialize ::`

Also used this task to generate Go BUILD graphs in the Medium mono repo
by just seeding go_binary targets for their main packages' dirs with:
`echo "go_binary(name='[parent dir]')" > BUILD`
and then running `buildgen.go`, finally pinning revs in the BUILD files
generated to their `3rdparty/golang` `go_remote_library` source root.

Testing Done:
New tests for GoBuildgen:
```console
$ ./pants test.pytest --coverage=modules:pants.contrib.go.tasks.go_buildgen contrib/go/tests/python/pants_test/contrib/go/tasks/:go_buildgen
...
contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_buildgen.py ................

=========== 16 passed in 1.97 seconds ============
Name                                                       Stmts   Miss Branch BrMiss  Cover
--------------------------------------------------------------------------------------------
contrib/go/src/python/pants/contrib/go/tasks/go_buildgen     192      4     72      8    95%
```

An example of the buildgen.go output with emphasis on contrib/go/examples/3rdparty
and a note that the FLOATING lines are warn/yellow:
```console
$ ./pants buildgen.go --remote --materialize ::
...
9:32:29 00:00 [main]
               (To run a reporting server: ./pants server)
19:32:29 00:00   [bootstrap]
19:32:29 00:00   [setup]
19:32:29 00:00     [parse]
               Executing tasks in goals: buildgen
19:32:30 00:01   [buildgen]
19:32:30 00:01     [go]
                   Auto generated the following Go BUILD files: BUILD file (import paths)
                   	contrib/go/examples/src/go/libA/BUILD (libA)
                   	contrib/go/examples/src/go/libC/BUILD (libC)
                   	contrib/go/examples/src/go/libB/BUILD (libB)
                   	contrib/go/examples/src/go/libE/BUILD (libE)
                   	contrib/go/examples/src/go/libD/BUILD (libD)
                   	contrib/go/examples/3rdparty/go/github.com/gorilla/context/BUILD (github.com/gorilla/context) FLOATING
                   	contrib/go/examples/3rdparty/go/github.com/AdRoll/goamz/BUILD (github.com/AdRoll/goamz/dynamodb) 51b70b003
                   	contrib/go/examples/src/go/hello/BUILD (hello)
                   	contrib/go/examples/src/go/server/BUILD (server)
                   	contrib/go/examples/3rdparty/go/github.com/bitly/go-simplejson/BUILD (github.com/bitly/go-simplejson) v0.4.3
                   	contrib/go/examples/3rdparty/go/github.com/gorilla/mux/BUILD (github.com/gorilla/mux) FLOATING
                   	contrib/go/examples/3rdparty/go/github.com/cbroglie/mapstructure/BUILD (github.com/cbroglie/mapstructure) 25325b46b
19:32:30 00:01   [complete]
               SUCCESS
```

CI went green here:
  https://travis-ci.org/pantsbuild/pants/builds/76587511

Bugs closed: 2016, 2039

Reviewed at https://rbcommons.com/s/twitter/r/2676/

15944 of 21534 relevant lines covered (74.04%)

1.39 hits per line

Jobs
ID Job ID Ran Files Coverage
1 6348.1 (CI_FLAGS="-cjlpn 'Various pants self checks'") 21 Aug 2015 07:19PM UTC 0
Travis Job 6348.1
2 6348.2 (CI_FLAGS="-fkmsrcn -u 0/2 'Unit tests for pants and pants-plugins - shard 1'") 21 Aug 2015 07:19PM UTC 0
69.63
Travis Job 6348.2
3 6348.3 (CI_FLAGS="-fkmsrcn -u 1/2 'Unit tests for pants and pants-plugins - shard 2'") 21 Aug 2015 07:20PM UTC 0
69.8
Travis Job 6348.3
4 6348.4 (CI_FLAGS="-fkmsrcjlp 'Python contrib tests'") 21 Aug 2015 07:22PM UTC 0
Travis Job 6348.4
5 6348.5 (CI_FLAGS="-fkmsrjlpn -i 0/6 'Python integration tests for pants - shard 1'") 21 Aug 2015 07:23PM UTC 0
Travis Job 6348.5
6 6348.6 (CI_FLAGS="-fkmsrjlpn -i 1/6 'Python integration tests for pants - shard 2'") 21 Aug 2015 07:25PM UTC 0
Travis Job 6348.6
7 6348.7 (CI_FLAGS="-fkmsrjlpn -i 2/6 'Python integration tests for pants - shard 3'") 21 Aug 2015 07:25PM UTC 0
Travis Job 6348.7
8 6348.8 (CI_FLAGS="-fkmsrjlpn -i 3/6 'Python integration tests for pants - shard 4'") 21 Aug 2015 07:31PM UTC 0
Travis Job 6348.8
9 6348.9 (CI_FLAGS="-fkmsrjlpn -i 4/6 'Python integration tests for pants - shard 5'") 21 Aug 2015 07:28PM UTC 0
Travis Job 6348.9
10 6348.10 (CI_FLAGS="-fkmsrjlpn -i 5/6 'Python integration tests for pants - shard 6'") 21 Aug 2015 07:30PM UTC 0
Travis Job 6348.10
Source Files on build 6348
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #6348
  • 83547f9c on github
  • Prev Build on master (#6346)
  • Next Build on master (#6351)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc