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

cmd/go: coverage profile should be cached with tests #23565

Open
bbrks opened this Issue Jan 26, 2018 · 5 comments

Comments

Projects
None yet
6 participants
@bbrks

bbrks commented Jan 26, 2018

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

@ALTree ALTree changed the title from Coverage profile should be cached with tests to cmd/go: coverage profile should be cached with tests Jan 26, 2018

@ALTree ALTree added this to the Go1.11 milestone Jan 26, 2018

@ianlancetaylor

This comment has been minimized.

Contributor

ianlancetaylor commented Jan 26, 2018

CC @rsc

@rsc rsc added the NeedsFix label Jan 29, 2018

@gopherbot

This comment has been minimized.

gopherbot commented Jan 30, 2018

Change https://golang.org/cl/90955 mentions this issue: cmd/go: coverage profile use cache if the set of arguements equals

@ianlancetaylor ianlancetaylor modified the milestones: Go1.11, Go1.12 Jul 6, 2018

@fgrosse

This comment has been minimized.

fgrosse commented 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

This comment has been minimized.

bbrks commented 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

This comment has been minimized.

fgrosse commented Aug 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment