<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/9444">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">CI: Fix bad reporting of status by the verification pub<br><br>Change-Id: I6f31a130b3ba0187149aaaa2ce94195a79e0f6a6<br>---<br>M tests/CI/ci.functions<br>M tests/CI/gates.jenkinsfile<br>M tests/CI/unittests.jenkinsfile<br>3 files changed, 46 insertions(+), 21 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/44/9444/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/CI/ci.functions b/tests/CI/ci.functions</span><br><span>index 55c460e..67616c2 100644</span><br><span>--- a/tests/CI/ci.functions</span><br><span>+++ b/tests/CI/ci.functions</span><br><span>@@ -3,6 +3,7 @@</span><br><span> # and can be "source"d from the scripts.</span><br><span> #</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+declare -a POSITIONAL_ARGS</span><br><span> for a in "$@" ; do</span><br><span>  OPTION_COUNT+=1</span><br><span>      case "$a" in</span><br><span>@@ -17,6 +18,9 @@</span><br><span>                   l=${BASH_REMATCH[1]//-/_}</span><br><span>                    eval ${l^^}=1</span><br><span>                        ;;</span><br><span style="color: hsl(120, 100%, 40%);">+            *)</span><br><span style="color: hsl(120, 100%, 40%);">+                    POSITIONAL_ARGS+=($a)</span><br><span style="color: hsl(120, 100%, 40%);">+                 ;;</span><br><span>   esac</span><br><span> done</span><br><span> </span><br><span>diff --git a/tests/CI/gates.jenkinsfile b/tests/CI/gates.jenkinsfile</span><br><span>index 7df6a8e..6cbf104 100644</span><br><span>--- a/tests/CI/gates.jenkinsfile</span><br><span>+++ b/tests/CI/gates.jenkinsfile</span><br><span>@@ -195,25 +195,29 @@</span><br><span>                        script {</span><br><span>                             def cat</span><br><span>                              def comment</span><br><span style="color: hsl(120, 100%, 40%);">+                           def rvalue</span><br><span>                           switch (currentBuild.currentResult) {</span><br><span>                                        case ~/^SUCCESS$/:</span><br><span>                                           cat = "Passed"</span><br><span>                                             comment = ""</span><br><span style="color: hsl(120, 100%, 40%);">+                                                rvalue = 2</span><br><span>                                           break</span><br><span>                                        case ~/^FAILURE$/:</span><br><span>                                           cat = "Failed"</span><br><span>                                             comment = "Fatal Error"</span><br><span style="color: hsl(120, 100%, 40%);">+                                             rvalue = -1</span><br><span>                                          break</span><br><span>                                        case ~/^UNSTABLE$/:</span><br><span>                                          cat = "Failed"</span><br><span>                                             comment = "Tests Failed"</span><br><span style="color: hsl(120, 100%, 40%);">+                                            rvalue = -1</span><br><span>                                          break</span><br><span>                                }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-                           gerritverificationpublisher verifyStatusCategory: cat,</span><br><span style="color: hsl(0, 100%, 40%);">-                                  verifyStatusURL: '', verifyStatusComment: comment,</span><br><span style="color: hsl(0, 100%, 40%);">-                                      verifyStatusName: '', verifyStatusReporter: 'Jenkins2',</span><br><span style="color: hsl(0, 100%, 40%);">-                                 verifyStatusRerun: 'regate'</span><br><span style="color: hsl(120, 100%, 40%);">+                           gerritverificationpublisher verifyStatusValue: rvalue,</span><br><span style="color: hsl(120, 100%, 40%);">+                                        verifyStatusCategory: cat, verifyStatusURL: '',</span><br><span style="color: hsl(120, 100%, 40%);">+                                       verifyStatusComment: comment, verifyStatusName: '',</span><br><span style="color: hsl(120, 100%, 40%);">+                                   verifyStatusReporter: 'Jenkins2', verifyStatusRerun: 'regate'</span><br><span>                        }</span><br><span>            }</span><br><span>            success {</span><br><span>diff --git a/tests/CI/unittests.jenkinsfile b/tests/CI/unittests.jenkinsfile</span><br><span>index d9f28e7..38e45fd 100644</span><br><span>--- a/tests/CI/unittests.jenkinsfile</span><br><span>+++ b/tests/CI/unittests.jenkinsfile</span><br><span>@@ -147,7 +147,7 @@</span><br><span>                 }</span><br><span>    }</span><br><span>    post {</span><br><span style="color: hsl(0, 100%, 40%);">-          always {</span><br><span style="color: hsl(120, 100%, 40%);">+              cleanup {</span><br><span>                    sh "sudo make distclean 2&>/dev/null || : "</span><br><span>                         sh "sudo rm -rf tests/CI/output 2&>/dev/null || : "</span><br><span>                 }</span><br><span>@@ -155,27 +155,44 @@</span><br><span>             * The Gerrit Trigger will automatically post the "Verified" results back</span><br><span>           * to Gerrit but the verification publisher publishes extra stuff in the</span><br><span>              * "Code Review" section of the review.</span><br><span style="color: hsl(0, 100%, 40%);">-               */</span><br><span style="color: hsl(120, 100%, 40%);">+             */</span><br><span style="color: hsl(120, 100%, 40%);">+           always {</span><br><span style="color: hsl(120, 100%, 40%);">+                      script {</span><br><span style="color: hsl(120, 100%, 40%);">+                              def cat</span><br><span style="color: hsl(120, 100%, 40%);">+                               def comment</span><br><span style="color: hsl(120, 100%, 40%);">+                           def rvalue</span><br><span style="color: hsl(120, 100%, 40%);">+                            switch (currentBuild.currentResult) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                 case ~/^SUCCESS$/:</span><br><span style="color: hsl(120, 100%, 40%);">+                                            cat = "Passed"</span><br><span style="color: hsl(120, 100%, 40%);">+                                              comment = ""</span><br><span style="color: hsl(120, 100%, 40%);">+                                                rvalue = 1</span><br><span style="color: hsl(120, 100%, 40%);">+                                            break</span><br><span style="color: hsl(120, 100%, 40%);">+                                 case ~/^FAILURE$/:</span><br><span style="color: hsl(120, 100%, 40%);">+                                            cat = "Failed"</span><br><span style="color: hsl(120, 100%, 40%);">+                                              comment = "Fatal Error"</span><br><span style="color: hsl(120, 100%, 40%);">+                                             rvalue = -1</span><br><span style="color: hsl(120, 100%, 40%);">+                                           break</span><br><span style="color: hsl(120, 100%, 40%);">+                                 case ~/^UNSTABLE$/:</span><br><span style="color: hsl(120, 100%, 40%);">+                                           cat = "Failed"</span><br><span style="color: hsl(120, 100%, 40%);">+                                              comment = "Tests Failed"</span><br><span style="color: hsl(120, 100%, 40%);">+                                            rvalue = -1</span><br><span style="color: hsl(120, 100%, 40%);">+                                           break</span><br><span style="color: hsl(120, 100%, 40%);">+                         }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+                           gerritverificationpublisher verifyStatusValue: rvalue,</span><br><span style="color: hsl(120, 100%, 40%);">+                                        verifyStatusCategory: cat, verifyStatusURL: '',</span><br><span style="color: hsl(120, 100%, 40%);">+                                       verifyStatusComment: comment, verifyStatusName: '',</span><br><span style="color: hsl(120, 100%, 40%);">+                                   verifyStatusReporter: 'Jenkins2', verifyStatusRerun: 'regate'</span><br><span style="color: hsl(120, 100%, 40%);">+                 }</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span>            success {</span><br><span style="color: hsl(0, 100%, 40%);">-                       echo "Reporting Passed"</span><br><span style="color: hsl(0, 100%, 40%);">-                       gerritverificationpublisher verifyStatusCategory: 'Passed',</span><br><span style="color: hsl(0, 100%, 40%);">-                             verifyStatusURL: '', verifyStatusComment: '',</span><br><span style="color: hsl(0, 100%, 40%);">-                           verifyStatusName: '', verifyStatusReporter: 'Jenkins2',</span><br><span style="color: hsl(0, 100%, 40%);">-                         verifyStatusRerun: 'recheck'</span><br><span style="color: hsl(120, 100%, 40%);">+                  echo "Reporting ${currentBuild.currentResult} Passed"</span><br><span>              }</span><br><span>            failure {</span><br><span style="color: hsl(0, 100%, 40%);">-                       echo "Reporting Failed: Fatal Error"</span><br><span style="color: hsl(0, 100%, 40%);">-                  gerritverificationpublisher verifyStatusCategory: 'Failed',</span><br><span style="color: hsl(0, 100%, 40%);">-                             verifyStatusURL: '', verifyStatusComment: 'Fatal Error',</span><br><span style="color: hsl(0, 100%, 40%);">-                                verifyStatusName: '', verifyStatusReporter: 'Jenkins2',</span><br><span style="color: hsl(0, 100%, 40%);">-                         verifyStatusRerun: 'recheck'</span><br><span style="color: hsl(120, 100%, 40%);">+                  echo "Reporting ${currentBuild.currentResult}: Failed: Fatal Error"</span><br><span>                }</span><br><span>            unstable {</span><br><span style="color: hsl(0, 100%, 40%);">-                      echo "Reporting Failed: Tests Failed"</span><br><span style="color: hsl(0, 100%, 40%);">-                 gerritverificationpublisher verifyStatusCategory: 'Failed',</span><br><span style="color: hsl(0, 100%, 40%);">-                             verifyStatusURL: '', verifyStatusComment: 'Tests Failed',</span><br><span style="color: hsl(0, 100%, 40%);">-                               verifyStatusName: '', verifyStatusReporter: 'Jenkins2',</span><br><span style="color: hsl(0, 100%, 40%);">-                         verifyStatusRerun: 'recheck'</span><br><span style="color: hsl(120, 100%, 40%);">+                  echo "Reporting ${currentBuild.currentResult}: Failed: Tests Failed"</span><br><span>               }</span><br><span>    }</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9444">change 9444</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/9444"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I6f31a130b3ba0187149aaaa2ce94195a79e0f6a6 </div>
<div style="display:none"> Gerrit-Change-Number: 9444 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>