Skip to content

Commit

Permalink
emit output of failed go tool cover invocation so users can try to de…
Browse files Browse the repository at this point in the history
…bug things for themselves
  • Loading branch information
onsi committed Jan 17, 2024
1 parent dca77c8 commit c245d09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ginkgo/internal/profiles_and_reports.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func FinalizeProfilesAndReportsForSuites(suites TestSuites, cliConfig types.CLIC
return messages, nil
}

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

0 comments on commit c245d09

Please sign in to comment.