Teamcity and Junit5: wrong report for parallel tests

Completed


We use TeamCity 10.0.1 to run selenium tests with Gradle 5 and JUnit 4.
We use Gradle maxParallelForks to parallel it. It works great, but this method of parallelization is not as efficient as we want.

We decided to move our tests on Junit5, we run gradle task (maxParallelForks = 1) which uses JUnit platform to run tests in parallel.
There is the peace of Gradle task:

test {
   useJUnitPlatform();
   systemProperty 'junit.jupiter.execution.parallel.enabled', 'true'
   systemProperty 'junit.jupiter.execution.parallel.mode.classes.default', 'concurrent'
   systemProperty 'junit.jupiter.execution.parallel.mode.default', 'concurrent'
}


it works, and it is more efficient.
But it seems like TeamCity builtin test autodetect mechanism is not working properly with junit5 and parallel tests:
we have the wrong statistics and reports - there are several tests in one report record. But Gradle and JUnit give us the right xml reports.

Is this an issue on TeamCity side or do we do something wrong? Will upgrade to the latest version of TeamCity solve this issue? Thanks!

0
2 comments

Hi,

 

support for parallel tasks has been consistently improved with new updates, and teamcity 10 has been out of support for well over a year now, so I'd recommend either upgrading or at the very least running a test server of the new version and testing it there.

This said, I'm not aware that this has been an issue, although junit 5 was released after teamcity 10. If you can replicate it in 2019.2, please post it to our issue tracker: https://youtrack.jetbrains.com/issues/TW

 

As a possible workaround, you might want to check whether importing the xml report via the xml report processing tool helps: https://www.jetbrains.com/help/teamcity/xml-report-processing.html

1
Avatar
Permanently deleted user

Thanks a lot! Seems like a new version of Teamcity solved our issue. 

0

Please sign in to leave a comment.