Apex: fix groovy build result update 45/38645/1
authorTim Rozet <trozet@redhat.com>
Wed, 2 Aug 2017 18:55:51 +0000 (14:55 -0400)
committerTim Rozet <trozet@redhat.com>
Wed, 2 Aug 2017 18:55:51 +0000 (14:55 -0400)
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 <trozet@redhat.com>
jjb/apex/apex.yml
jjb/apex/apex.yml.j2
jjb/apex/update-build-result.groovy

index 98a19d4..d4ae54f 100644 (file)
                   abort-all-job: true
                   git-revision: false
 
+    publishers:
+        - groovy-postbuild:
+            script:
+                !include-raw-escape: ./update-build-result.groovy
 
 # Baremetal test job
 - job-template:
                   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:
 #            steps:
 #                - shell: 'echo "Tests Passed"'
 
-    publishers:
-        - groovy-postbuild:
-            script:
-                !include-raw-escape: ./update-build-result.groovy
-
 
 # danube Daily
 - job-template:
index a3cc9c6..5d7f150 100644 (file)
                   abort-all-job: true
                   git-revision: false
 
+    publishers:
+        - groovy-postbuild:
+            script:
+                !include-raw-escape: ./update-build-result.groovy
 
 # Baremetal test job
 - job-template:
                   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:
 #            steps:
 #                - shell: 'echo "Tests Passed"'
 
-    publishers:
-        - groovy-postbuild:
-            script:
-                !include-raw-escape: ./update-build-result.groovy
-
 {% for stream in scenarios %}
 # {{ stream }} Daily
 - job-template:
index a569e51..1679582 100644 (file)
@@ -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
 }