mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
CI: Fix bad reporting of status by the verification pub
Change-Id: I6f31a130b3ba0187149aaaa2ce94195a79e0f6a6
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
# and can be "source"d from the scripts.
|
# and can be "source"d from the scripts.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
declare -a POSITIONAL_ARGS
|
||||||
for a in "$@" ; do
|
for a in "$@" ; do
|
||||||
OPTION_COUNT+=1
|
OPTION_COUNT+=1
|
||||||
case "$a" in
|
case "$a" in
|
||||||
@@ -17,6 +18,9 @@ for a in "$@" ; do
|
|||||||
l=${BASH_REMATCH[1]//-/_}
|
l=${BASH_REMATCH[1]//-/_}
|
||||||
eval ${l^^}=1
|
eval ${l^^}=1
|
||||||
;;
|
;;
|
||||||
|
*)
|
||||||
|
POSITIONAL_ARGS+=($a)
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@@ -195,25 +195,29 @@ pipeline {
|
|||||||
script {
|
script {
|
||||||
def cat
|
def cat
|
||||||
def comment
|
def comment
|
||||||
|
def rvalue
|
||||||
switch (currentBuild.currentResult) {
|
switch (currentBuild.currentResult) {
|
||||||
case ~/^SUCCESS$/:
|
case ~/^SUCCESS$/:
|
||||||
cat = "Passed"
|
cat = "Passed"
|
||||||
comment = ""
|
comment = ""
|
||||||
|
rvalue = 2
|
||||||
break
|
break
|
||||||
case ~/^FAILURE$/:
|
case ~/^FAILURE$/:
|
||||||
cat = "Failed"
|
cat = "Failed"
|
||||||
comment = "Fatal Error"
|
comment = "Fatal Error"
|
||||||
|
rvalue = -1
|
||||||
break
|
break
|
||||||
case ~/^UNSTABLE$/:
|
case ~/^UNSTABLE$/:
|
||||||
cat = "Failed"
|
cat = "Failed"
|
||||||
comment = "Tests Failed"
|
comment = "Tests Failed"
|
||||||
|
rvalue = -1
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
gerritverificationpublisher verifyStatusCategory: cat,
|
gerritverificationpublisher verifyStatusValue: rvalue,
|
||||||
verifyStatusURL: '', verifyStatusComment: comment,
|
verifyStatusCategory: cat, verifyStatusURL: '',
|
||||||
verifyStatusName: '', verifyStatusReporter: 'Jenkins2',
|
verifyStatusComment: comment, verifyStatusName: '',
|
||||||
verifyStatusRerun: 'regate'
|
verifyStatusReporter: 'Jenkins2', verifyStatusRerun: 'regate'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
success {
|
success {
|
||||||
|
@@ -147,7 +147,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
always {
|
cleanup {
|
||||||
sh "sudo make distclean 2&>/dev/null || : "
|
sh "sudo make distclean 2&>/dev/null || : "
|
||||||
sh "sudo rm -rf tests/CI/output 2&>/dev/null || : "
|
sh "sudo rm -rf tests/CI/output 2&>/dev/null || : "
|
||||||
}
|
}
|
||||||
@@ -155,27 +155,44 @@ pipeline {
|
|||||||
* The Gerrit Trigger will automatically post the "Verified" results back
|
* The Gerrit Trigger will automatically post the "Verified" results back
|
||||||
* to Gerrit but the verification publisher publishes extra stuff in the
|
* to Gerrit but the verification publisher publishes extra stuff in the
|
||||||
* "Code Review" section of the review.
|
* "Code Review" section of the review.
|
||||||
*/
|
*/
|
||||||
|
always {
|
||||||
|
script {
|
||||||
|
def cat
|
||||||
|
def comment
|
||||||
|
def rvalue
|
||||||
|
switch (currentBuild.currentResult) {
|
||||||
|
case ~/^SUCCESS$/:
|
||||||
|
cat = "Passed"
|
||||||
|
comment = ""
|
||||||
|
rvalue = 1
|
||||||
|
break
|
||||||
|
case ~/^FAILURE$/:
|
||||||
|
cat = "Failed"
|
||||||
|
comment = "Fatal Error"
|
||||||
|
rvalue = -1
|
||||||
|
break
|
||||||
|
case ~/^UNSTABLE$/:
|
||||||
|
cat = "Failed"
|
||||||
|
comment = "Tests Failed"
|
||||||
|
rvalue = -1
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
gerritverificationpublisher verifyStatusValue: rvalue,
|
||||||
|
verifyStatusCategory: cat, verifyStatusURL: '',
|
||||||
|
verifyStatusComment: comment, verifyStatusName: '',
|
||||||
|
verifyStatusReporter: 'Jenkins2', verifyStatusRerun: 'regate'
|
||||||
|
}
|
||||||
|
}
|
||||||
success {
|
success {
|
||||||
echo "Reporting Passed"
|
echo "Reporting ${currentBuild.currentResult} Passed"
|
||||||
gerritverificationpublisher verifyStatusCategory: 'Passed',
|
|
||||||
verifyStatusURL: '', verifyStatusComment: '',
|
|
||||||
verifyStatusName: '', verifyStatusReporter: 'Jenkins2',
|
|
||||||
verifyStatusRerun: 'recheck'
|
|
||||||
}
|
}
|
||||||
failure {
|
failure {
|
||||||
echo "Reporting Failed: Fatal Error"
|
echo "Reporting ${currentBuild.currentResult}: Failed: Fatal Error"
|
||||||
gerritverificationpublisher verifyStatusCategory: 'Failed',
|
|
||||||
verifyStatusURL: '', verifyStatusComment: 'Fatal Error',
|
|
||||||
verifyStatusName: '', verifyStatusReporter: 'Jenkins2',
|
|
||||||
verifyStatusRerun: 'recheck'
|
|
||||||
}
|
}
|
||||||
unstable {
|
unstable {
|
||||||
echo "Reporting Failed: Tests Failed"
|
echo "Reporting ${currentBuild.currentResult}: Failed: Tests Failed"
|
||||||
gerritverificationpublisher verifyStatusCategory: 'Failed',
|
|
||||||
verifyStatusURL: '', verifyStatusComment: 'Tests Failed',
|
|
||||||
verifyStatusName: '', verifyStatusReporter: 'Jenkins2',
|
|
||||||
verifyStatusRerun: 'recheck'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user