Skip to content

Commit 92024e0

Browse files
committed
add debug info
1 parent 9aa4b8e commit 92024e0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/testcoverage/coverage/profile.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import (
66
"strings"
77

88
"golang.org/x/tools/cover"
9+
10+
"github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/logger"
911
)
1012

1113
func parseProfiles(paths []string) ([]*cover.Profile, error) {
@@ -77,6 +79,13 @@ func mergeSameFileProfile(ap, bp *cover.Profile) (*cover.Profile, error) {
7779
b.NumStmt == a.NumStmt {
7880
ap.Blocks[i].Count = max(a.Count, b.Count)
7981
} else {
82+
logger.L.Debug().
83+
Str("a-file", ap.FileName).
84+
Interface("a", a).
85+
Str("b-file", bp.FileName).
86+
Interface("b", b).
87+
Msg("inconsistent profile data")
88+
8089
return nil, fmt.Errorf("inconsistent profile data [%q, %q]", ap.FileName, bp.FileName)
8190
}
8291
}

0 commit comments

Comments
 (0)