From 7526c8d3471659c4021f9a98dfa44d7a0727d151 Mon Sep 17 00:00:00 2001 From: ced42 <17880812+ced42@users.noreply.github.com> Date: Thu, 7 May 2020 16:05:10 +0200 Subject: [PATCH] Add tests, failures and errors attributes on testsuites (#1072) --- pkg/printers/junitxml.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/printers/junitxml.go b/pkg/printers/junitxml.go index b3d42809..9277cd66 100644 --- a/pkg/printers/junitxml.go +++ b/pkg/printers/junitxml.go @@ -17,6 +17,9 @@ type testSuitesXML struct { type testSuiteXML struct { XMLName xml.Name `xml:"testsuite"` Suite string `xml:"name,attr"` + Tests int `xml:"tests,attr"` + Errors int `xml:"errors,attr"` + Failures int `xml:"failures,attr"` TestCases []testCaseXML `xml:"testcase"` } @@ -46,6 +49,8 @@ func (JunitXML) Print(ctx context.Context, issues []result.Issue) error { suiteName := i.FilePath() testSuite := suites[suiteName] testSuite.Suite = i.FilePath() + testSuite.Tests++ + testSuite.Failures++ tc := testCaseXML{ Name: i.FromLinter,