diff --git a/junit/junit.go b/junit/junit.go index d439315..7723d96 100644 --- a/junit/junit.go +++ b/junit/junit.go @@ -160,10 +160,6 @@ func CreateFromReport(report gtr.Report, hostname string) Testsuites { suite.AddTestcase(createTestcaseForTest(pkg.Name, test)) } - for _, bm := range pkg.Benchmarks { - suite.AddTestcase(createTestcaseForBenchmark(pkg.Name, bm)) - } - // JUnit doesn't have a good way of dealing with build or runtime // errors that happen before a test has started, so we create a single // failing test that contains the build error details. @@ -231,29 +227,6 @@ func createTestcaseForTest(pkgName string, test gtr.Test) Testcase { return tc } -func createTestcaseForBenchmark(pkgName string, bm gtr.Benchmark) Testcase { - tc := Testcase{ - Classname: pkgName, - Name: bm.Name, - Time: formatDuration(bm.ApproximateDuration()), - } - - if bm.Result == gtr.Fail { - tc.Failure = &Result{ - Message: "Failed", - Data: formatOutput(bm.Output, 0), - } - } else if bm.Result == gtr.Skip { - tc.Skipped = &Result{ - Message: "Skipped", - Data: formatOutput(bm.Output, 0), - } - } else if len(bm.Output) > 0 { - tc.SystemOut = &Output{Data: formatOutput(bm.Output, 0)} - } - return tc -} - // formatDuration returns the JUnit string representation of the given // duration. func formatDuration(d time.Duration) string { diff --git a/junit/junit_test.go b/junit/junit_test.go index 54b21a9..41f628e 100644 --- a/junit/junit_test.go +++ b/junit/junit_test.go @@ -14,9 +14,9 @@ func TestCreateFromReport(t *testing.T) { report := gtr.Report{ Packages: []gtr.Package{ { - Benchmarks: []gtr.Benchmark{ + Tests: []gtr.Test{ { - Name: "BenchmarkFail", + Name: "TestFail", Result: gtr.Fail, }, }, @@ -35,7 +35,7 @@ func TestCreateFromReport(t *testing.T) { ID: 0, Testcases: []Testcase{ { - Name: "BenchmarkFail", + Name: "TestFail", Time: "0.000", Failure: &Result{Message: "Failed"}, },