diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 35734f69ee7..c488c3a2fb5 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -160,7 +160,7 @@ steps: - label: ":junit: Junit annotate" plugins: - junit-annotate#v2.5.0: - artifacts: "build/*.xml" + artifacts: "**TEST-*.xml" always-annotate: true agents: provider: "gcp" diff --git a/dev-tools/mage/gotest.go b/dev-tools/mage/gotest.go index c061fbc75d1..11294caa333 100644 --- a/dev-tools/mage/gotest.go +++ b/dev-tools/mage/gotest.go @@ -5,7 +5,6 @@ package mage import ( - "bytes" "context" "errors" "fmt" @@ -341,42 +340,6 @@ func GoTest(ctx context.Context, params GoTestArgs) error { } } - // Generate an XML code coverage report. - var codecovReport string - if params.CoverageProfileFile != "" { - fmt.Println(">> go run gocover-cobertura:", params.CoverageProfileFile, "Started") - - // execute gocover-cobertura in order to create cobertura report - // install pre-requisites - installCobertura := sh.RunCmd("go", "install", "github.com/boumenot/gocover-cobertura@latest") - if err = installCobertura(); err != nil { - return fmt.Errorf("failed to install gocover-cobertura: %w", err) - } - - codecovReport = strings.TrimSuffix(params.CoverageProfileFile, - filepath.Ext(params.CoverageProfileFile)) + "-cov.xml" - - coverage, err := os.ReadFile(params.CoverageProfileFile) - if err != nil { - return fmt.Errorf("failed to read code coverage report: %w", err) - } - - coberturaFile, err := os.Create(codecovReport) - if err != nil { - return err - } - defer coberturaFile.Close() - - coverToXML := exec.Command("gocover-cobertura") - coverToXML.Stdout = coberturaFile - coverToXML.Stderr = os.Stderr - coverToXML.Stdin = bytes.NewReader(coverage) - if err = coverToXML.Run(); err != nil { - return fmt.Errorf("failed to write XML code coverage report: %w", err) - } - fmt.Println(">> go run gocover-cobertura:", params.CoverageProfileFile, "Created") - } - // Return an error indicating that testing failed. if goTestErr != nil { fmt.Println(">> go test:", params.LogName, "Test Failed")