-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
Jenkins 2.89.3
The problem is that our Jenkins file is using parallel() and executes several maven builds (using withMaven).
We then have some custom logic after each maven execution to analyze failing tests. The problem is that they accumulate in "currentBuild" and we cannot find the tests related to the maven execution that just happened.
FYI the way we retrieve failing tests is:
AbstractTestResultAction testResultAction = currentBuild.rawBuild.getAction(AbstractTestResultAction.class) def failedTests = testResultAction.getResult().getFailedTests()
See also https://groups.google.com/forum/?nomobile=true#!topic/jenkinsci-users/dDDPC486JWE
I've tried to put some logic to save failing tests before and after each maven execution but it cannot work because of "parallel" (all maven executions starting in parallel save an empty state of failing tests and as soon as one of them gets a failing test, they'll all report it failing and send duplicate emails):
- https://github.com/xwiki/xwiki-jenkins-pipeline/blob/master/vars/xwikiBuild.groovy#L112
- https://github.com/xwiki/xwiki-jenkins-pipeline/blob/master/vars/xwikiBuild.groovy#L210
So right now we're stuck and missing a way to get the test result for a single maven execution.
Thanks
I have similar issue.
The Jenkinsfile is running the same maven project in parallel with jdk8 and jdk9.
So the results are confusing and no easy way to understand which test has failed with which jdk.
Could we have more than one TestResultAction per build?
Ideally I would like to add a label to it.
```
step([$class: 'JUnitResultArchiver', label: somelabel here,
testResults: '*/target/surefire-reports/TEST-.xml'])
```
WDYT?