Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/build/cmd/coordinator: some subrepos want to run tests in both module and GOPATH modes #30233

dmitshur opened this issue Feb 14, 2019 · 2 comments


Copy link

commented Feb 14, 2019

coordinator already had support for running tests (at least trybots) in module mode, it's used for oauth2 and build subrepos:

Some subrepos, such as x/tools, may want to soon start running their tests in both GO111MODULE=on and GO111MODULE=off modes, in order to make sure there are no regressions in either mode.

We should add support for this to the coordinator.

/cc @bradfitz @matloob


This comment has been minimized.

Copy link
Member Author

commented Feb 14, 2019

I see two ways this can be implemented:

  • a more lightweight way (i.e., without having to run all tests twice) by adding a new GOPATH mode builder for just one GOOS/GOARCH, similar to how we do that for running tests on previous supported versions of Go, e.g., see here
  • a more heavyweight way, run tests in both modes on each GOOS/GOARCH combination

This comment has been minimized.

Copy link

commented Sep 9, 2019

Change mentions this issue: cmd/coordinator: detect current build mode in subrepo tests

@dmitshur dmitshur added the Testing label Sep 10, 2019
gopherbot pushed a commit to golang/build that referenced this issue Sep 11, 2019
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
Run-TryBot: Dmitri Shuralyov <>
TryBot-Result: Gobot Gobot <>
Reviewed-by: Andrew Bonventre <>
Reviewed-by: Brad Fitzpatrick <>
Reviewed-by: Alexander Rakoczy <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.