Skip to content

Commit

Permalink
Apex: fix groovy build result update
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
trozet committed Aug 2, 2017
1 parent eeec59f commit 2b13f8e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 25 deletions.
16 changes: 4 additions & 12 deletions jjb/apex/apex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -774,11 +771,6 @@
# steps:
# - shell: 'echo "Tests Passed"'

publishers:
- groovy-postbuild:
script:
!include-raw-escape: ./update-build-result.groovy


# danube Daily
- job-template:
Expand Down
16 changes: 4 additions & 12 deletions jjb/apex/apex.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion jjb/apex/update-build-result.groovy
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 2b13f8e

Please sign in to comment.