x/build/cmd/coordinator: switch to "./..." import path pattern for testing packages in a module #51455
Labels
Builders
x/build issues (builders, bots, dashboards)
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
Back when GOPATH mode was default, assuming one GOPATH workspace, running "go test ./..." in $GOPATH/src/root had the same effect as running "go test {root}/...". The latter was more explicit and did the stated thing even if it was accidentally run from the wrong directory. Maybe that's why it was chosen, or maybe it was chosen arbitrarily, since both worked and did the same thing.
That invocation persisted to today, when module mode is used, and for each module to be tested the coordinator runs "go test {module-root}/..." invocations at the module root to test packages contained inside that module:
(source)
From #51283 I've learned there's a difference in that "{module-root}/..." may select a package with import path "{module-root}" even if that package is in another module, but "./..." won't do that.
Since there's no need for the pattern to match any packages outside of the very module it's meant to cover, we could consider switching. It would not fail if a go.sum entry that
go mod tidy
doesn't currently insert isn't added in some cases (see #51283), remove possibility of unintentional duplicate coverage of packages in nested modules, and least importantly it is shorter visually.CC @golang/release, @bcmills, @matloob.
The text was updated successfully, but these errors were encountered: