Testunit xml converter to generic format in sonarqube issue

I am using sonarqube version 8.9 and I am trying to populate unit test result into my sonarqube analysis. I have xml report from unit test but can’t find the way to convert unit test xml data into generic format of sonarqube. can anyone please help.

below is example of unit test xml data.

Hi,

What’s your coverage provider? There may already be a converter available.

 
Ann

Hi @ganncamp ,

It’s utPLSQL, Can you suggest how we can convert xml generated from utPLSQL to Sonarqube generic xml?

Hi,

I’m not aware of an existing converter for that format. Sorry, but you’ll need to build this yourself.

 
Ann

Hi,

The utPLSQL already generates the unit test / coverage report in the format required by SonarQube with the ut_sonar_test_reporter / ut_coverage_sonar_reporter reporters.

For example, using utPLSQL-cli you can do:

utplsql run <db info and other test arguments> -f=ut_sonar_test_reporter -o=tests.xml -f=ut_coverage_sonar_reporter -o=coverage.xml -source_path=<source dir> -test_path=<test dir>

Be warned that getting it right is a bit… complicated.

1 Like

Thanks @felipebz!

I’ve just checked the Guides category & we don’t seem to have anything on this.

I can copy/paste what you’ve provided into a new guide, but that’s all I’d be doing. If you wanted to write this up, I’d be thrilled to move it into the Guides category…

 
Ann

tbh, configuring it correctly may be hard and I already wrote a better guide, so I don’t want to write a detailed post about it here.

I’ll be happy to help anyone on the utPLSQL community, but I don’t think this forum is the right place to explain the utPLSQL specifics.

3 Likes

Hi @felipebz,

Fair enough! We’ve added your guide to the central listing:

And thanks for your work on this!

 
Ann

1 Like