1

As described on this issue, Jenkins1 adds the property maven.test.failure.ignore when executing Surefire & Failsafe plugins, so when tests fail on a build, the job continues. Eventually, the maven state is SUCCESS and jenkins state is UNSTABLE.

On Jenkins2, the behaviour seems different, the job fails if Failsafe "verify" goal reports any failure.

Is there a way to configure the Jenkins2 job to have the Jenkins1 behaviour ? (Except by adding manually the maven property...)

Matthieu Saleta
  • 1,388
  • 1
  • 11
  • 17

1 Answers1

0

Jenkins 1 projects have a lifecycle participant that hooks into the Maven lifecycle. As yet that has not been upgraded to support the pipelines.

You could use a pipeline script to look at the failsafe-summary file and set the build to UNSTABLE where there are failures and FAILED where there are errors.

You could also execute the verify step in a try catch and set the build to unstable if the verify fails. If you do this in two stages e.g. up to package first so failure here will fail the build correctly. The just make the verify step unstable which will include starting, stopping and running integration tests. Thats probably the most meaningful thing to do.