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
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.
Most helpful comment
We should document this