Skip to content

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

Closed
@bbrks

Description

@bbrks

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

changed the title [-]Coverage profile should be cached with tests[/-] [+]cmd/go: coverage profile should be cached with tests[/+] on Jan 26, 2018
added
NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.
on Jan 26, 2018
added this to the Go1.11 milestone on Jan 26, 2018
ianlancetaylor

ianlancetaylor commented on Jan 26, 2018

@ianlancetaylor
Contributor

CC @rsc

added
NeedsFixThe path to resolution is known, but the work has not been done.
on Jan 29, 2018
removed
NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.
on Jan 29, 2018
gopherbot

gopherbot commented on Jan 30, 2018

@gopherbot
Contributor

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

modified the milestones: Go1.11, Go1.12 on Jul 6, 2018
fgrosse

fgrosse commented on Aug 6, 2018

@fgrosse

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

bbrks commented on Aug 6, 2018

@bbrks
Author

@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

fgrosse commented on Aug 6, 2018

@fgrosse
nightlyone

nightlyone commented on Jan 24, 2019

@nightlyone
Contributor

Is this still planned for Go1.12 ? I guess not...

removed this from the Go1.12 milestone on Feb 12, 2019

97 remaining items

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoCommandcmd/goNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Participants

      @rsc@karelbilek@dinvlad@andybons@fgrosse

      Issue actions

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