How to rerun Xcode unit test in case of failure?

I found this issue about rerun unit tests. However, I couldn’t understand how to use (Experimental) Rerun test, when it fails?, or where I can find more information about this. Does it work when the test fail?

I also find this

which basically tells to use run_if: .IsBuildFailed, however, I couldn’t understand how to use this. I would have 2 test steps? One that would run and another that would be the fallback?

Thats basically what it says, It will be something like the one below that uses the script step. The script step will only run if the gradle-runner task fails.

- gradle-runner@1:
    inputs:
    - app_file_include_filter: |
        *.apk
        *.aab
        *.aar
    - gradle_options: "--stacktrace "
    - gradle_task: "$GRADLEW_RELEASE_TARGET"
    title: Publish Releases


- script@1:
    title: Failure handling
    run_if: ".IsBuildFailed"
    is_always_run: true
    inputs:
    - content: |
        #!/usr/bin/env bash
        set -e
       #do failure handling steps here

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.