Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
x/build/cmd/coordinator: some subrepos want to run tests in both module and GOPATH modes #30233
coordinator already had support for running tests (at least trybots) in module mode, it's used for
Some subrepos, such as x/tools, may want to soon start running their tests in both
We should add support for this to the coordinator.
I see two ways this can be implemented:
It will be necessary to know whether the current environment and configuration has resulted in module mode or GOPATH mode being selected. Do this dynamically by invoking 'go env GOMOD', since the outcome depends on the version of Go and its default GO111MODULE behavior, as well as whether a go.mod file is added to the subrepo, and what environment overrides were applied by coordinator via the BuildConfig.ModulesEnv method. This requires the repository being tested to be available on disk, so move the step of fetching it to happen earlier. For now, this change only detects and logs the build mode. Future changes will use this information further. Updates golang/go#34190 Updates golang/go#32528 Updates golang/go#30233 Change-Id: I641becaaae5b6cfad22961d8864a877241e61cd3 Reviewed-on: https://go-review.googlesource.com/c/build/+/194277 Run-TryBot: Dmitri Shuralyov <email@example.com> TryBot-Result: Gobot Gobot <firstname.lastname@example.org> Reviewed-by: Andrew Bonventre <email@example.com> Reviewed-by: Brad Fitzpatrick <firstname.lastname@example.org> Reviewed-by: Alexander Rakoczy <email@example.com>