From 75ecf04538451ce53a44dbda452262c3c41b5590 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Thu, 23 May 2019 13:35:20 -0400 Subject: [PATCH] Add bool to force only failed job to run Signed-off-by: Jonathan Rajotte --- jobs/system-tests.yaml | 4 ++++ scripts/system-tests/system-trigger.groovy | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/jobs/system-tests.yaml b/jobs/system-tests.yaml index 13f9919..92def44 100644 --- a/jobs/system-tests.yaml +++ b/jobs/system-tests.yaml @@ -388,6 +388,10 @@ name: 'FORCE_JOB_RUN' default: false description: 'Force the child jobs to run' + - bool: + name: 'FORCE_FAILED_JOB_RUN' + default: false + description: 'Force the failed child jobs to run' properties: - build-discarder: diff --git a/scripts/system-tests/system-trigger.groovy b/scripts/system-tests/system-trigger.groovy index 154ba05..8267c55 100644 --- a/scripts/system-tests/system-trigger.groovy +++ b/scripts/system-tests/system-trigger.groovy @@ -414,7 +414,8 @@ currentJobs.each { jobName, jobInfo -> // if the config has not changed, we keep it. // if it's failed, we don't launch a new job and keep it failed. jobInfo['status'] = pastJob['status']; - if (pastJob['status'] == 'FAILED') { + if (pastJob['status'] == 'FAILED' && + build.getBuildVariables().get('FORCE_FAILED_JOB_RUN') == 'false') { println("${jobName} as not changed since the last failed run. Don't run it again."); // Marked the umbrella job for failure but still run the jobs that since the // last run. -- 2.34.1