Had something to do with having the same surefire suite name in both calls.
Hints came from comments in method add(SuiteResult sr) in TestResult.java
<https://github.com/jenkinsci/junit-plugin/blob/master/src/main/java/hudson/tasks/junit/TestResult.java>
.
I changed the suite name in the second project's pom like so
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.surefire.plugin}</version>
<configuration>
<properties>
<property>
<name>suitename</name>
<value>IntegrationSuite</value>
</property>
</properties>
</configuration>
</plugin>
</plugins>
On Wednesday, 29 June 2016 12:10:09 UTC+10, Lionel Orellana wrote:
>
> Hello,
>
> I have to make two different maven invocations to build my app and run
> some tests.
>
> This is all within the same node/stage at the moment.
>
> 1) sh "${global.mvnCmd} -Dmaven.test.failure.ignore clean install "
> archive '**/*.ear, **/pom.xml'
> step([$class: 'JUnitResultArchiver', testResults:
> '**/target/surefire-reports/TEST-*.xml'])
>
>
> 2) sh "${global.mvnCmd} -f module/pom.xml -Dmaven.test.failure.ignore
> test"
> step([$class: 'JUnitResultArchiver', testResults:
> '**/target/surefire-reports/TEST-*.xml'])
>
>
> There are tests failing in the second call but the build/pipeline is not
> being marked as UNSTABLE even though the Test Results do show the failed
> tests. If I comment out 1) then the build/pipeline does get marked as
> UNSTABLE.
>
> So it appears the JUnitResultArchiver can only set the result once?
>
> The end goal is to run unit tests as part of 1) and exit if there are
> failed tests (I can check the build result which would haven been set by
> JUnitResultArchiver). If 1) is Ok we'll run longer tests with 2). But that
> will only work if JUnitResultArchiver can set the build result the a second
> time.
>
> Thanks
>
> Lionel.
>
>
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/aa7bb53d-86be-45cf-a223-1cc403bc268e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.