You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not a bug, but it looks like if !HasTestMain && len(Names) == 0 then the
package undertest is not used.
But that is a useless test -- if there is no TestMain being called, and no
Test* functions, then nothing will happen.
If anything is missing, it is that we don't have something that errros out
if the above condition is true just before the "tmp :=" line you linked.
When I use bazel to build my go_test, it shows the error:
ERROR: /root/testgo/hsa-service-center/src/servicecenter/controllers/BUILD:35:1: null failed: linux-sandbox failed: error executing command /root/.cache/bazel/_bazel_root/40633db3e907142ca23269a67b71fa41/execroot/src/_bin/linux-sandbox ... (remaining 3 argument(s) skipped). bazel-out/local-fastbuild/bin/servicecenter/controllers/instance_watcher_main_test.go:7: imported and not used: "servicecenter/controllers/instance_watcher" as undertest Target //servicecenter/controllers:instance_watcher failed to build
but when I delete the line https://github.com/bazelbuild/rules_go/blob/master/go/tools/generate_test_main.go#L95 ,
it works. Is it a bug?
The text was updated successfully, but these errors were encountered: