Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
9633e9df
Commit
9633e9df
authored
6 years ago
by
George Joseph
Browse files
Options
Downloads
Patches
Plain Diff
CI: Fix bad reporting of status by the verification pub
Change-Id: I6f31a130b3ba0187149aaaa2ce94195a79e0f6a6
parent
b8d75bbb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/CI/ci.functions
+4
-0
4 additions, 0 deletions
tests/CI/ci.functions
tests/CI/gates.jenkinsfile
+8
-4
8 additions, 4 deletions
tests/CI/gates.jenkinsfile
tests/CI/unittests.jenkinsfile
+34
-17
34 additions, 17 deletions
tests/CI/unittests.jenkinsfile
with
46 additions
and
21 deletions
tests/CI/ci.functions
+
4
−
0
View file @
9633e9df
...
...
@@ -3,6 +3,7 @@
# and can be "source"d from the scripts.
#
declare -a POSITIONAL_ARGS
for a in "$@" ; do
OPTION_COUNT+=1
case "$a" in
...
...
@@ -17,6 +18,9 @@ for a in "$@" ; do
l=${BASH_REMATCH[1]//-/_}
eval ${l^^}=1
;;
*)
POSITIONAL_ARGS+=($a)
;;
esac
done
...
...
This diff is collapsed.
Click to expand it.
tests/CI/gates.jenkinsfile
+
8
−
4
View file @
9633e9df
...
...
@@ -196,25 +196,29 @@ pipeline {
script
{
def
cat
def
comment
def
rvalue
switch
(
currentBuild
.
currentResult
)
{
case
~
/^SUCCESS$/
:
cat
=
"Passed"
comment
=
""
rvalue
=
2
break
case
~
/^FAILURE$/
:
cat
=
"Failed"
comment
=
"Fatal Error"
rvalue
=
-
1
break
case
~
/^UNSTABLE$/
:
cat
=
"Failed"
comment
=
"Tests Failed"
rvalue
=
-
1
break
}
gerritverificationpublisher
verifyStatus
Category:
cat
,
verifyStatus
URL:
''
,
verifyStatus
Comment:
comment
,
verifyStatus
Name:
''
,
verifyStatusReporter:
'Jenkins2
'
,
verifyStatusRerun:
'regate'
gerritverificationpublisher
verifyStatus
Value:
rvalue
,
verifyStatus
Category:
cat
,
verifyStatus
URL:
''
,
verifyStatus
Comment:
comment
,
verifyStatusName:
'
'
,
verifyStatusReporter:
'Jenkins2'
,
verifyStatusRerun:
'regate'
}
}
success
{
...
...
This diff is collapsed.
Click to expand it.
tests/CI/unittests.jenkinsfile
+
34
−
17
View file @
9633e9df
...
...
@@ -146,7 +146,7 @@ pipeline {
}
}
post
{
always
{
cleanup
{
sh
"sudo make distclean 2&>/dev/null || : "
sh
"sudo rm -rf tests/CI/output 2&>/dev/null || : "
}
...
...
@@ -154,27 +154,44 @@ pipeline {
* The Gerrit Trigger will automatically post the "Verified" results back
* to Gerrit but the verification publisher publishes extra stuff in the
* "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
{
echo
"Reporting Passed"
gerritverificationpublisher
verifyStatusCategory:
'Passed'
,
verifyStatusURL:
''
,
verifyStatusComment:
''
,
verifyStatusName:
''
,
verifyStatusReporter:
'Jenkins2'
,
verifyStatusRerun:
'recheck'
echo
"Reporting ${currentBuild.currentResult} Passed"
}
failure
{
echo
"Reporting Failed: Fatal Error"
gerritverificationpublisher
verifyStatusCategory:
'Failed'
,
verifyStatusURL:
''
,
verifyStatusComment:
'Fatal Error'
,
verifyStatusName:
''
,
verifyStatusReporter:
'Jenkins2'
,
verifyStatusRerun:
'recheck'
echo
"Reporting ${currentBuild.currentResult}: Failed: Fatal Error"
}
unstable
{
echo
"Reporting Failed: Tests Failed"
gerritverificationpublisher
verifyStatusCategory:
'Failed'
,
verifyStatusURL:
''
,
verifyStatusComment:
'Tests Failed'
,
verifyStatusName:
''
,
verifyStatusReporter:
'Jenkins2'
,
verifyStatusRerun:
'recheck'
echo
"Reporting ${currentBuild.currentResult}: Failed: Tests Failed"
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment