From a87f51931487efb6f3b0772bfdcd0dce91f68e71 Mon Sep 17 00:00:00 2001 From: Anderson Queiroz Date: Wed, 26 Jul 2023 11:14:21 +0200 Subject: [PATCH] remove debug --- dev-tools/mage/gotest.go | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/dev-tools/mage/gotest.go b/dev-tools/mage/gotest.go index 99addcbac4b..082d9748a39 100644 --- a/dev-tools/mage/gotest.go +++ b/dev-tools/mage/gotest.go @@ -308,29 +308,15 @@ func GoTest(ctx context.Context, params GoTestArgs) error { var htmlCoverReport string if params.CoverageProfileFile != "" { - htmlCoverReport = strings.TrimSuffix(params.CoverageProfileFile, filepath.Ext(params.CoverageProfileFile)) + ".html" - coverToHTML := sh.OutCmd("go", "tool", "cover", + coverToHTML := sh.RunCmd("go", "tool", "cover", "-html="+params.CoverageProfileFile, "-o", htmlCoverReport) - if out, err := coverToHTML(); err != nil { - fmt.Println("==================================================") - fmt.Println("===========go tool cover output===================") - fmt.Println(out) - fmt.Println("==================================================") - // ignore known issue, see https://github.com/elastic/beats/issues/35927 - if !(strings.Contains(out, "can't read") && - strings.Contains(out, "filebeat/input/syslog/format_check.rl")) { - return fmt.Errorf("failed to write HTML code coverage report: %w", err) - } - - fmt.Println(">> go test: go tool cover returned an error, but " + - "will ignore it, see https://github.com/elastic/beats/issues/35927") - fmt.Println(">> go test: the error was:") - fmt.Println(">> go test:", err.Error()) + if err := coverToHTML(); err != nil { + return fmt.Errorf("failed to write HTML code coverage report: %w", err) } }