Cucumber 4 jvm vuelve a ejecutar pruebas fallidas en jenkins usando el comando de shell

1 minuto de lectura

Agregué el comando de ejecución a mi comando de shell jenkins:

cd apitests && ./gradlew cucumber -Pthreads=${THREADS} -Ptags="not @notReady" && [ -s rerun/failed_scenarios.txt ] && ./gradlew cucumber -PfeaturePath="@rerun/failed_scenarios.txt" -Pthreads=80 || echo "File empty"

En gradle, agregué una tarea con opciones de pepino que configuré para guardar la prueba fallida en el archivo:

cucumber {
    threads = 50
    glue="classpath:com.sixtleasing.cucumber.steps"
    plugin = ["pretty", "html:target/zucchini", "json:target/zucchini.json", "rerun:rerun/failed_scenarios.txt"] 
    (...)
}

Todo funciona cuando todas las pruebas son verdes. El problema comienza cuando una de las pruebas falla. En ese caso veo en la consola:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':cucumber'.
> java.lang.RuntimeException: The execution failed

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

¿por qué? Si ejecuto comandos por separado, funciona, pero en jenkins como un comando de shell no funciona

¿Ha sido útil esta solución?