]> Cypherpunks repositories - gostls13.git/commit
cmd/go: cache coverage profile with tests
authorRyan Currah <ryan@currah.ca>
Tue, 25 Feb 2025 15:51:56 +0000 (15:51 +0000)
committerMichael Matloob <matloob@golang.org>
Thu, 6 Mar 2025 16:27:15 +0000 (08:27 -0800)
commit6a4bc8d17eb6703baf0c483fb40e0d3e1f0f6af3
tree05dab79dbcdad4eb868ba0eec76afb4f1ad631f0
parent938b6c15e92e6a80b8368798a350a1a811487d88
cmd/go: cache coverage profile with tests

This CL stores coverage profile data in the GOCACHE under the
'coverprofile' subkey alongside tests. This makes tests which use
coverage profiles cacheable. The values of the -coverprofile and
-outputdir flags are not included in the cache key to allow cached
profile data to be written to any output file.

Note: This is a rebase and squash from the original PRs below that
was created/closed/abandoned by @jproberts and @macnibblet that I
plan to maintain.

- https://github.com/golang/go/pull/50483
- https://github.com/golang/go/pull/65657

I made improvements to the change based on feedback from @bcmills in Gerrit
https://go-review.googlesource.com/c/go/+/563138.

From @macnibblet:

I don't know if anyone has considered the environmental impact
(Yes, of course, dev experience too), but on a team with 3 backend
developers, when I replaced our CI Golang version with this build,
it reduced the build time by 50%, which would have
equated to about 5000 hours of CI reduced in the past year.

Fixes #23565

Change-Id: I59a20af5ea156f990a17544cf06dc667ae7f8aa3
GitHub-Last-Rev: a5a1d1b9c87ff433d16f656fc8988e1cb1ce7100
GitHub-Pull-Request: golang/go#69339
Reviewed-on: https://go-review.googlesource.com/c/go/+/610564
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
src/cmd/go/alldocs.go
src/cmd/go/internal/test/cover.go
src/cmd/go/internal/test/test.go
src/cmd/go/testdata/script/test_cache_inputs.txt