Skip to content

Commit c245d09

Browse files
committedJan 17, 2024
emit output of failed go tool cover invocation so users can try to debug things for themselves
1 parent dca77c8 commit c245d09

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎ginkgo/internal/profiles_and_reports.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func FinalizeProfilesAndReportsForSuites(suites TestSuites, cliConfig types.CLIC
144144
return messages, nil
145145
}
146146

147-
//loads each profile, combines them, deletes them, stores them in destination
147+
// loads each profile, combines them, deletes them, stores them in destination
148148
func MergeAndCleanupCoverProfiles(profiles []string, destination string) error {
149149
combined := &bytes.Buffer{}
150150
modeRegex := regexp.MustCompile(`^mode: .*\n`)
@@ -184,7 +184,7 @@ func GetCoverageFromCoverProfile(profile string) (float64, error) {
184184
cmd := exec.Command("go", "tool", "cover", "-func", profile)
185185
output, err := cmd.CombinedOutput()
186186
if err != nil {
187-
return 0, fmt.Errorf("Could not process Coverprofile %s: %s", profile, err.Error())
187+
return 0, fmt.Errorf("Could not process Coverprofile %s: %s - %s", profile, err.Error(), string(output))
188188
}
189189
re := regexp.MustCompile(`total:\s*\(statements\)\s*(\d*\.\d*)\%`)
190190
matches := re.FindStringSubmatch(string(output))

0 commit comments

Comments
 (0)
Please sign in to comment.