Using multiple JUnit result files on the Jenkins pipeline

On my Jenkins kernel, I run unit tests for both configurations: debug and release. Each test configuration generates a separate JUnit XML result file. Test names for both versions: debugging and release are the same. I am currently using the following junit command to show test results:

junit allowEmptyResults: true, healthScaleFactor: 0.0, keepLongStdio: true, testResults: 'Test-Dir/Artifacts/test_xml_reports_*/*.xml'

The problem is that both are on Jenkins UI: the debug and release test results are displayed together, and it is impossible to find out which test (from the debug or release configuration) failed. Is it possible to show the results of debugging and release of tests separately? If so, how can I do this?

+6
source share
2 answers

There is no solution to my question. As a workaround, I changed the format of the JUnit XML report and included the assembly option name (debug / release) as the package name.

+1
source

We run the same integration tests with two different configurations with different types of databases. We use maven and a failover plugin, so I use -Dsurefire.reportNameSuffix so that I can see the difference between the two starts.

The following is an example block of our Jenkins file:

 stage('Integration test MySql') { steps { timeout(75) { sh("mvn -e verify -DskipUnitTests=true -DtestConfigResource=conf/mysql-local.yaml " + "-DintegrationForkCount=1 -DdbInitMode=migrations -Dmaven.test.failure.ignore=false " + "-Dsurefire.reportNameSuffix=MYSQL) } } post { always { junit '**/failsafe-reports/*MYSQL.xml' } } } 

In the report, integration tests are performed with mysql and then displayed with MYSQL added to their name.

0
source

Source: https://habr.com/ru/post/1014451/


All Articles