Rules_go: Run benchmarks

Created on 25 Aug 2016  路  8Comments  路  Source: bazelbuild/rules_go

Does a go_test support running benchmarks? I tried running the resulting binary with -test.bench=., but it doesn't seem to do anything, and I don't see any reference to benchmark handling in geneate_test_main.go

documentation enhancement

Most helpful comment

We should document this

All 8 comments

Right. It is not supported right now.

This is fixed in https://github.com/bazelbuild/rules_go/pull/230. The benchmark is working now.

@ghasemloo could you give an example of how to run this? I'm not sure how this works?

@hntd187 You need to directly run the test binary (found in bazel-bin) yourself. Running go test -test.bench=. <binary> should do the trick :)

You can run it using bazel as follows:
bazel run path/to/package:go_default_test -- -test.bench=.
where go_default_test is the target name of the test in BUILD file.

We should document this

We should document this

Was it ever documented?

Meh, never mind. Just saw the linked issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Globegitter picture Globegitter  路  5Comments

ixdy picture ixdy  路  4Comments

mikewiacek picture mikewiacek  路  3Comments

apesternikov picture apesternikov  路  3Comments

jayconrod picture jayconrod  路  6Comments