cmd/go: make -coverpkg properly ignore special directories - #66171
cmd/go: make -coverpkg properly ignore special directories#66171matthewhughes934 wants to merge 1 commit into
Conversation
|
This PR (HEAD: 63eb9f4) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/569895. Important tips:
|
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Than McIntosh: Patch Set 1: (4 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Than McIntosh: Patch Set 1: Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Go LUCI: Patch Set 1: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2024-03-07T20:26:10Z","revision":"d5dac6a21a14a19b1eb45dfacf35bdc8488894bc"} Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Than McIntosh: Patch Set 1: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Go LUCI: Patch Set 1: This CL has failed the run. Reason: Tryjob golang/try/x_tools-gotip-linux-amd64 has failed with summary (view all results): FAILURE
Error: Links:
Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Go LUCI: Patch Set 1: LUCI-TryBot-Result-1 Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
63eb9f4 to
9396509
Compare
|
Message from Matthew Hughes: Patch Set 1: (4 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Matthew Hughes: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
This PR (HEAD: 9396509) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/569895. Important tips:
|
|
Message from Than McIntosh: Patch Set 2: Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Go LUCI: Patch Set 2: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2024-03-07T20:57:14Z","revision":"88466b937d61663e96ed462c4b285d1f36287a49"} Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Go LUCI: Patch Set 2: LUCI-TryBot-Result-1 Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Than McIntosh: Patch Set 3: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Emmanuel Odeke: Patch Set 3: Hold+1 (4 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
-coverpkg not ignoring special directories|
This PR (HEAD: 4ba4bea) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/569895. Important tips:
|
|
Message from Matthew Hughes: Patch Set 4: (5 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Emmanuel Odeke: Patch Set 4: -Hold Code-Review+1 Commit-Queue+1 Run-TryBot+1 (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Go LUCI: Patch Set 4: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2024-03-19T18:58:12Z","revision":"4f35b335166bbf175ec73f9b1b1f0e54251f0fd9"} Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Gopher Robot: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
4ba4bea to
7093c8e
Compare
|
Message from Matthew Hughes: Patch Set 4: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
This PR (HEAD: 7093c8e) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/569895. Important tips:
|
|
Message from Gopher Robot: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Gopher Robot: Patch Set 4: TryBot-Result-1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Matthew Hughes: Patch Set 9: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Than McIntosh: Patch Set 9: Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Go LUCI: Patch Set 9: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2024-04-15T12:49:58Z","revision":"dfc007b2baa838f2713d400bc183480a81b2d778"} Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Than McIntosh: Patch Set 9: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Go LUCI: Patch Set 9: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Go LUCI: Patch Set 9: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
09944b0 to
f48bd17
Compare
|
This PR (HEAD: f48bd17) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/569895. Important tips:
|
f48bd17 to
1c0d215
Compare
|
This PR (HEAD: 1c0d215) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/569895. Important tips:
|
|
Message from Funda Secgin: Patch Set 11: Code-Review+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Funda Secgin: Patch Set 11: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
1c0d215 to
c541b18
Compare
|
Message from Matthew Hughes: Patch Set 11: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
This PR (HEAD: c541b18) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/569895. Important tips:
|
|
Message from Michael Matloob: Patch Set 12: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Michael Matloob: Patch Set 12: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Michael Matloob: Patch Set 12: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from Funda Secgin: Patch Set 12: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
c541b18 to
8a5d07c
Compare
|
Message from Emmanuel Odeke: Patch Set 12: Code-Review+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
This PR (HEAD: 8a5d07c) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/569895. Important tips:
|
|
Message from Emmanuel Odeke: Patch Set 13: Code-Review+1 Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from golang-scoped@luci-project-accounts.iam.gserviceaccount.com: Patch Set 13: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2026-08-05T19:40:26Z","revision":"d8ba09966762ee4f682e743862fd3db17b5a0d12"} Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
The pattern passed to `-coverpkg` when running `go test` would not ignore directories usually ignored by the `go` command, i.e. those beginning with "." or "_" are ignored by the go tool, as are directories named "testdata". Fix this by adding an explicit check for these (by following a similar check in `src/cmd/doc/dirs.go`[1]) allowing us to ignore them. The scope of the change is limted to package matching to only the -coverpkg flag of `go test` to avoid impacting -gcflags and the other per package flags, e.g. we don't want to change behaviour for a user building something that imports a leading dot package who wants to set gcflags for it See linked issue for a reproduction. Fixes golang#66038 [1] https://go.googlesource.com/go/+/16e5d24480dca7ddcbdffb78a8ed5de3e5155dec/src/cmd/doc/dirs.go#136
|
Message from Emmanuel Odeke: Patch Set 13: -Commit-Queue (Performed by <GERRIT_ACCOUNT_60063> on behalf of <GERRIT_ACCOUNT_5137>) Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from golang-scoped@luci-project-accounts.iam.gserviceaccount.com: Patch Set 13: This CL has failed the run. Reason: Tryjob golang/try/gotip-linux-amd64_avx512 has failed with summary (view all results):
To reproduce, try Additional links for debugging: Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
|
Message from golang-scoped@luci-project-accounts.iam.gserviceaccount.com: Patch Set 13: LUCI-TryBot-Result-1 Please don’t reply on this GitHub thread. Visit golang.org/cl/569895. |
8a5d07c to
e854004
Compare
|
This PR (HEAD: e854004) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/569895. Important tips:
|
This change fixes "go test -coverpkg" to properly ignore
special directories that are typically ignored by the "go" command
for example directories beginnning with "." or "_" or "testdata"
Fixes #66038