From 20ecf4f20eaff75ee7d82d748c5801fb1d72d393 Mon Sep 17 00:00:00 2001 From: Darek Slusarczyk Date: Thu, 21 Sep 2023 13:07:38 +0200 Subject: [PATCH] fix build restart behaviour - reset build envars at each start reset our envars at each start of a new build it seems jenkins keeps values of envars in the case of a restarted build so we could get a result like: Status: changed, regression, unsuccessful, failure, changed, unsuccessful, unstable see e.g., status of the build trunk #182 which restarted from build #181 Change-Id: I17b125de5306835b0cdad406c671b30317b75960 --- tests/ci/pipeline/utils.groovy | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/ci/pipeline/utils.groovy b/tests/ci/pipeline/utils.groovy index 4ebbeecf6..1a62d9de9 100644 --- a/tests/ci/pipeline/utils.groovy +++ b/tests/ci/pipeline/utils.groovy @@ -71,6 +71,17 @@ def yesOrNo(boolean flag) { } def initEnv() { + env.INIT_STAGE_SUCCEEDED = false + env.BUILD_STAGE_SUCCEEDED = false + env.MINIKUBE_RESULT_STATUS = env.TEST_RESULTS_UNAVAILABLE + env.K3D_RESULT_STATUS = env.TEST_RESULTS_UNAVAILABLE + env.KIND_RESULT_STATUS = env.TEST_RESULTS_UNAVAILABLE + env.TEST_SUITE_REPORT = "" + env.TESTS_SUITE_ISSUES = "" + env.BUILD_DURATION = "" + env.CHANGE_LOG = "" + env.BUILD_STATUS = "" + env.WORKERS_FOLDER = 'Shell/KubernetesOperator/' + "${isCIExperimentalBuild() ? 'sandbox' : 'workers'}" env.BUILD_TRIGGERED_BY = getTriggeredBy(params.OPERATOR_TRIGGERED_BY) env.TESTS_DIR = "${WORKSPACE}/tests" @@ -395,7 +406,7 @@ def getChangeLog() { def modifyBuildStatus(String status) { if (!env.BUILD_STATUS) { env.BUILD_STATUS = status - } else { + } else if (!env.BUILD_STATUS.contains(status)) { env.BUILD_STATUS += ", " + status } }