From 42f5f1af630e6c49c48a0f4c81603d539767f5f5 Mon Sep 17 00:00:00 2001 From: Cedric Lachat Date: Wed, 6 May 2020 21:36:45 +0200 Subject: [PATCH] Add tests, failures and errors attributes on testsuites --- pkg/printers/junitxml.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/printers/junitxml.go b/pkg/printers/junitxml.go index b3d4280961c4..9277cd66f2fe 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,