Closed
Description
As briefly discussed here: https://twitter.com/_rsc/status/956888213314068481
I don't see why Go shouldn't cache the results of -coverprofile
when running tests, as test coverage shouldn't vary from run to run, given the same set of arguments.
What version of Go are you using (go version
)?
go version go1.10rc1 darwin/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env
)?
$GOOS="darwin"
$GOARCH="amd64"
What did you do?
Call go test -coverprofile=coverprofile.out ./...
multiple times.
What did you expect to see?
Test results cached between runs.
$ go test -coverprofile=coverprofile.out ./...
ok github.com/bbrks/tmp 2.893s coverage: 46.1% of statements
$ go test -coverprofile=coverprofile.out ./...
ok github.com/bbrks/tmp (cached)
What did you see instead?
Test results were not cached between runs.
$ go test -coverprofile=coverprofile.out ./...
ok github.com/bbrks/tmp 2.893s coverage: 46.1% of statements
$ go test -coverprofile=coverprofile.out ./...
ok github.com/bbrks/tmp 2.893s coverage: 46.1% of statements
Activity
[-]Coverage profile should be cached with tests[/-][+]cmd/go: coverage profile should be cached with tests[/+]ianlancetaylor commentedon Jan 26, 2018
CC @rsc
gopherbot commentedon Jan 30, 2018
Change https://golang.org/cl/90955 mentions this issue:
cmd/go: coverage profile use cache if the set of arguements equals
fgrosse commentedon Aug 6, 2018
I was hoping this change would make it into go1.11 but it seems its not working yet in
go1.11beta3
. Looking at the CL it seems it got stuck due to merge conflicts? Any chance we can pick up this issue and still include it in v11?bbrks commentedon Aug 6, 2018
@fgrosse Looks like it's being targeted for 1.12 now. I don't think it will be rescheduled this close to 1.11's release.
fgrosse commentedon Aug 6, 2018
nightlyone commentedon Jan 24, 2019
Is this still planned for Go1.12 ? I guess not...
97 remaining items