From c245d09a1a083f643ad2b91878cf060146cc94e3 Mon Sep 17 00:00:00 2001 From: Onsi Fakhouri Date: Wed, 17 Jan 2024 15:49:32 -0700 Subject: [PATCH] emit output of failed go tool cover invocation so users can try to debug things for themselves --- ginkgo/internal/profiles_and_reports.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ginkgo/internal/profiles_and_reports.go b/ginkgo/internal/profiles_and_reports.go index bd3c6d028..26de28b57 100644 --- a/ginkgo/internal/profiles_and_reports.go +++ b/ginkgo/internal/profiles_and_reports.go @@ -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`) @@ -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))