cmd/go: source path regression for "go test -coverprofile" in local mode with GOEXPERIMENT=coverageredesign #56433
Labels
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
release-blocker
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
No, only on tip.
What operating system and processor architecture are you using (
go env
)?linux/amd64
What did you do?
Here is a toy program with two files, "prog.go" and "prog_test.go":
https://go.dev/play/p/sJ-n2bOWQSi
Run this command:
What did you expect to see?
Expect to see a cov.out file with these contents:
What did you see instead?
It looks as though the new coverage implementation didn't properly bring forward this code in cmd/go:
https://go.googlesource.com/go/+/51af90445696772703ed88d967e8c23c8e9e992d/src/cmd/go/internal/load/pkg.go#3403
This blob has the effect of forcing a full path for the source file recorded in the coverage instrumentation in the "local" case. This is happening for old-style instrumentation but not with new style instrumentation.
The text was updated successfully, but these errors were encountered: