Why would fastlane scan tests keep rebuilding and running in Jenkins Pipeline? Why would fastlane scan tests keep rebuilding and running in Jenkins Pipeline? jenkins jenkins

Why would fastlane scan tests keep rebuilding and running in Jenkins Pipeline?


So ultimately I think I've gotten to the bottom of the issue here.

If I wrap my Test stage in a try/catch block, then I get appropriate behaviour from the job.

stage 'Tests'            try {                    env.FASTLANE_EXPLICIT_OPEN_SIMULATOR = 1                    bash 'bundle exec fastlane test'                } catch (e) {                    currentBuild.result = 'FAILURE'                    throw e                }

This doesn't really make sense since my entire section is wrapped in a try/catch - so if someone has insight as to WHY this works, i'm all ears.But at least I am able to work around the issue right now.


Looks like test case is failing but Jenkins job is not stopping.Could be two possibilities here:

  1. Try exiting the job once the test case fails, so it won't continue after, hence added explicit exit 1 if test case execution fails Example

    stage('Run Tests') {// Shell build stepsh """ #!/bin/bashecho "Executing Fastlane test lane..."$HOME/.fastlane/bin/fastlane tests || exit 1;"""     }
  2. Check if test case changing if source code file and doing the commit back to the SCM, and on commit/push Jenkins would be polling hence resulting in a loop.

To solve this use polling ignore on commit/user/message basis. Adding screenshot for reference

enter image description here