Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
2eaa58e0
"git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "f00cd6efbd00b0273f58c393a617415b5d1d410e"
Unverified
Commit
2eaa58e0
authored
Apr 27, 2022
by
Rhett Ying
Committed by
GitHub
Apr 27, 2022
Browse files
[CI] refine status check (#3958)
parent
6e46bbf5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
tests/scripts/ci_report/status.py
tests/scripts/ci_report/status.py
+6
-10
No files found.
tests/scripts/ci_report/status.py
View file @
2eaa58e0
...
@@ -4,17 +4,13 @@ JOB_NAME = os.getenv("JOB_NAME")
...
@@ -4,17 +4,13 @@ JOB_NAME = os.getenv("JOB_NAME")
BUILD_NUMBER
=
os
.
getenv
(
"BUILD_NUMBER"
)
BUILD_NUMBER
=
os
.
getenv
(
"BUILD_NUMBER"
)
BUILD_ID
=
os
.
getenv
(
"BUILD_ID"
)
BUILD_ID
=
os
.
getenv
(
"BUILD_ID"
)
job_link
=
os
.
environ
[
"BUILD_URL"
]
job_link
=
os
.
environ
[
"BUILD_URL"
]
response
=
requests
.
get
(
'{}wfapi'
.
format
(
job_link
)).
json
()
response
=
requests
.
get
(
'{}wfapi'
.
format
(
job_link
)).
json
()
# IN_PROGRESS is expected, sincce the pipeline is not finished when executing this script
status
=
"✅ CI test succeeded"
success
=
response
[
"status"
]
in
[
'SUCCESS'
,
'IN_PROGRESS'
]
for
v
in
response
[
'stages'
]:
if
'FAILED'
in
v
[
'status'
]:
if
success
:
status
=
"❌ CI test failed in Stage [{}]."
.
format
(
v
[
'name'
])
status
=
"✅ CI test succeeded"
break
else
:
status
=
"❌ CI test failed"
comment
=
f
"""
{
JOB_NAME
}
comment
=
f
"""
{
JOB_NAME
}
{
status
}
\n
{
status
}
\n
...
@@ -22,4 +18,4 @@ Report at [link](https://dgl-ci-result.s3.us-west-2.amazonaws.com/{JOB_NAME}/{BU
...
@@ -22,4 +18,4 @@ Report at [link](https://dgl-ci-result.s3.us-west-2.amazonaws.com/{JOB_NAME}/{BU
Full logs at [link](https://dgl-ci-result.s3.us-west-2.amazonaws.com/
{
JOB_NAME
}
/
{
BUILD_NUMBER
}
/
{
BUILD_ID
}
/logs/cireport.log)
Full logs at [link](https://dgl-ci-result.s3.us-west-2.amazonaws.com/
{
JOB_NAME
}
/
{
BUILD_NUMBER
}
/
{
BUILD_ID
}
/logs/cireport.log)
"""
"""
print
(
comment
)
print
(
comment
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment