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

pantsbuild / pants / 6348 / 2
0%
main: 93%

Build:
Build:
LAST BUILD BRANCH: add/remove-python-trampoline-overhead
DEFAULT BRANCH: main
Ran 21 Aug 2015 07:19PM UTC
Files 354
Run time 12s
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

21 Aug 2015 07:00PM UTC coverage: 69.629%. Remained the same
CI_FLAGS="-fkmsrcn -u 0/2 'Unit tests for pants and pants-plugins - shard 1'"

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/

14994 of 21534 relevant lines covered (69.63%)

0.7 hits per line

Source Files on job 6348.2 (CI_FLAGS="-fkmsrcn -u 0/2 'Unit tests for pants and pants-plugins - shard 1'")
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 6348
  • Travis Job 6348.2
  • 83547f9c on github
  • Prev Job for CI_FLAGS="-fkmsrcn -u 0/2 'Unit tests for pants and pants-plugins - shard 1'" on master (#6346.2)
  • Next Job for CI_FLAGS="-fkmsrcn -u 0/2 'Unit tests for pants and pants-plugins - shard 1'" on master (#6351.2)
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