Skip to content

Commit

Permalink
remove debug
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersonQ committed Jul 26, 2023
1 parent 97e92fc commit a87f519
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions dev-tools/mage/gotest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit a87f519

Please sign in to comment.