Robert Munteanu
Robert Munteanu

Reputation: 68308

Jenkins declarative pipeline - settings stable/unstable threshold

I am working on a project with a Jenkinsfile setup. This project runs on a number of integration tests, some of which are expected to fail. We are fixing the tests ( or the implementation ) one by one, but in the meantime the jobs are marked as failed.

The relevant state snippet is

    stage ('Run ITs') {
        steps {
            sh 'SHOW_LOGS=0 ./compose/scripts/up-testing.sh'
            sh 'sleep 60'
            timeout (720) {
                sh './testing/scripts/run-its.sh'
            }
        }

        post {
            always {
                sh './testing/scripts/summarize-it-results.sh'
                junit 'testing/failsafe-resports/*.xml'
                sh './compose/scripts/killall.sh'
            }
    }

I'd like to set a threshold (T) on the number of failures + errors (F+E) and mark the build as unstable if we get F+E <= T and failed otherwise.

How can I do this with the Jenkins pipeline plugin?

Upvotes: 2

Views: 2016

Answers (1)

Vadim Kotov
Vadim Kotov

Reputation: 8284

I think it is currently not possible with JUnit plugin "out-of-the-box". Here is the corresponding issue in Jenkins issue tracker.

Upvotes: 2

Related Questions