From: Tim Rozet Date: Wed, 2 Aug 2017 18:55:51 +0000 (-0400) Subject: Apex: fix groovy build result update X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=2b13f8ee486f4f8ae1c66ac3b95148d9a423318b;p=releng.git Apex: fix groovy build result update The groovy script is working, but it is changing the 'apex test suite' phase to unstable and we really want it to change the 'scenario' job result to unstable if deploy passed but tests failed. Therefore this patch moves the groovy plugin to execute on the scenario job, and looks for deploy successful before changing the build result. Change-Id: I1b6907f4fb2647e644c4a627be6e481fff32f195 Signed-off-by: Tim Rozet --- diff --git a/jjb/apex/apex.yml b/jjb/apex/apex.yml index 98a19d43d..d4ae54f9f 100644 --- a/jjb/apex/apex.yml +++ b/jjb/apex/apex.yml @@ -681,6 +681,10 @@ abort-all-job: true git-revision: false + publishers: + - groovy-postbuild: + script: + !include-raw-escape: ./update-build-result.groovy # Baremetal test job - job-template: @@ -757,13 +761,6 @@ enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-(nosdn-nofeature|nosdn-kvm|odl_l3-fdio)-ha/" abort-all-job: false git-revision: false - - conditional-step: - condition-kind: current-status - condition-worst: SUCCESS - condtion-best: SUCCESS - on-evaluation-failure: mark-unstable - steps: - - shell: 'echo "Tests Passed"' # Build status is always success due conditional plugin prefetching # build status before multijob phases execute # - conditional-step: @@ -774,11 +771,6 @@ # steps: # - shell: 'echo "Tests Passed"' - publishers: - - groovy-postbuild: - script: - !include-raw-escape: ./update-build-result.groovy - # danube Daily - job-template: diff --git a/jjb/apex/apex.yml.j2 b/jjb/apex/apex.yml.j2 index a3cc9c658..5d7f150cd 100644 --- a/jjb/apex/apex.yml.j2 +++ b/jjb/apex/apex.yml.j2 @@ -611,6 +611,10 @@ abort-all-job: true git-revision: false + publishers: + - groovy-postbuild: + script: + !include-raw-escape: ./update-build-result.groovy # Baremetal test job - job-template: @@ -687,13 +691,6 @@ enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-(nosdn-nofeature|nosdn-kvm|odl_l3-fdio)-ha/" abort-all-job: false git-revision: false - - conditional-step: - condition-kind: current-status - condition-worst: SUCCESS - condtion-best: SUCCESS - on-evaluation-failure: mark-unstable - steps: - - shell: 'echo "Tests Passed"' # Build status is always success due conditional plugin prefetching # build status before multijob phases execute # - conditional-step: @@ -704,11 +701,6 @@ # steps: # - shell: 'echo "Tests Passed"' - publishers: - - groovy-postbuild: - script: - !include-raw-escape: ./update-build-result.groovy - {% for stream in scenarios %} # {{ stream }} Daily - job-template: diff --git a/jjb/apex/update-build-result.groovy b/jjb/apex/update-build-result.groovy index a569e51f8..1679582c8 100644 --- a/jjb/apex/update-build-result.groovy +++ b/jjb/apex/update-build-result.groovy @@ -1,4 +1,5 @@ import hudson.model.* -if (manager.build.@result == hudson.model.Result.FAILURE) { +if (manager.logContains("^.*apex-deploy-baremetal.*SUCCESS$") + && manager.build.@result == hudson.model.Result.FAILURE) { manager.build.@result = hudson.model.Result.UNSTABLE }