go2xunit icon indicating copy to clipboard operation
go2xunit copied to clipboard

Feature/sonar generic data format

Open djgilcrease opened this issue 6 years ago • 3 comments

This adds the ability to output in the Sonar Qube Generic Test Data format https://docs.sonarqube.org/display/SONAR/Generic+Test+Data

I created a new template for the sonar output, and added a template function that allows you to get the test file a test exists in as required by the Generic Test Data format

djgilcrease avatar May 09 '18 00:05 djgilcrease

This creates output that looks like

<?xml version="1.0" encoding="UTF-8"?>
<testExecutions version="1">
  <file path="github.com/group/project/cmd/server/repository/repository_test.go">
    <testCase name="TestGetPolicy_ValidPolicyName" duration="0">
      <failure message="error">
        <![CDATA[	repository_test.go:67: Expected to find policy schema for tcp-proxy
	repository_test.go:71: Expected to find policy schema for tcp-proxy to match test data
	repository_test.go:77: Expected to find policy schema for tcp-proxy
	repository_test.go:81: Expected to find policy schema for tcp-proxy to match test data]]>
      </failure>
    </testCase>
  </file>
  <file path="github.com/group/project/cmd/server/repository/repository_test.go">
    <testCase name="TestGetPolicy_InvalidPolicyName" duration="0" />
  </file>
  <file path="github.com/group/project/cmd/server/repository/repository_test.go">
    <testCase name="TestGetPolicy_MissingArtifact" duration="0" />
  </file>
</testExecutions>

djgilcrease avatar May 09 '18 01:05 djgilcrease

Thanks, I'll have a look soon-ish ...

tebeka avatar May 09 '18 07:05 tebeka

Will take a look at these issue this week.

djgilcrease avatar May 21 '18 15:05 djgilcrease