Skip to content

Commit

Permalink
fix build restart behaviour - reset build envars at each start
Browse files Browse the repository at this point in the history
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 bitpoke#182 which restarted from build bitpoke#181

Change-Id: I17b125de5306835b0cdad406c671b30317b75960
  • Loading branch information
marinesovitch committed Sep 21, 2023
1 parent 1f1cab6 commit 20ecf4f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/ci/pipeline/utils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
}
Expand Down

0 comments on commit 20ecf4f

Please sign in to comment.