scoverage/scoverage-maven-plugin

scoverage and Parallel Stages in a Jenkins Declarative Pipeline

smrosenberry opened this issue · 1 comments

I have a multi-module Maven project written in Scala with over 3000 unit tests. To keep build times almost reasonable, those unit tests are run in 6 parallel stages. Complicating matters, I also need scoverage to tell us why we need 4000 unit tests ;)

The build runs first and the 6 parallel test stages after. Problem is I'm only seeing the coverage in SonarQube from the last test stage to complete. The working theory being the last stage wins the race overwriting the scoverage.xml file. I believe my problem is this line in the scoverage.maven.plugin where the file name is hard coded. [EDIT: This line is not the problem! It is simply reporting the location of the scoverage.xml file written by the ScoverageXmlWriter in the line above.]

I tried using the scoverage.xmlOutputDirectory and scoverage.dataDirectory to include the stage name in the value to isolate the scoverage.xml file for each stage in its own directory, but that appears to blow up Maven. Maybe not surprising since both parameters are annotated as read-only.

Am I missing the obvious and if so, what?

Hi @smrosenberry
seems like it's a duplicate of #83. This is a know limitation - the plugin is not thread-safe.
I've added a note on this in #190.
I will close this one and keep #83 open. Please reopen with more details if you think this one is different