Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
60d5bda4
Commit
60d5bda4
authored
Apr 30, 2021
by
Lysandre
Browse files
Patch notification service
parent
b29eb247
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
utils/notification_service.py
utils/notification_service.py
+12
-9
No files found.
utils/notification_service.py
View file @
60d5bda4
...
@@ -160,6 +160,7 @@ if __name__ == "__main__":
...
@@ -160,6 +160,7 @@ if __name__ == "__main__":
results
[
job
]
=
{
"failed"
:
0
,
"success"
:
0
,
"time_spent"
:
""
,
"failures"
:
""
}
results
[
job
]
=
{
"failed"
:
0
,
"success"
:
0
,
"time_spent"
:
""
,
"failures"
:
""
}
for
key
,
file_path
in
file_dict
.
items
():
for
key
,
file_path
in
file_dict
.
items
():
try
:
with
open
(
file_path
.
replace
(
"[]"
,
"stats"
))
as
f
:
with
open
(
file_path
.
replace
(
"[]"
,
"stats"
))
as
f
:
failed
,
success
,
time_spent
=
handle_test_results
(
f
.
read
())
failed
,
success
,
time_spent
=
handle_test_results
(
f
.
read
())
results
[
job
][
"failed"
]
+=
failed
results
[
job
][
"failed"
]
+=
failed
...
@@ -169,6 +170,8 @@ if __name__ == "__main__":
...
@@ -169,6 +170,8 @@ if __name__ == "__main__":
for
line
in
f
:
for
line
in
f
:
if
re
.
search
(
"FAILED"
,
line
):
if
re
.
search
(
"FAILED"
,
line
):
results
[
job
][
"failures"
]
+=
line
results
[
job
][
"failures"
]
+=
line
except
FileNotFoundError
:
print
(
"Artifact was not found, job was probably canceled."
)
# Remove the trailing ", "
# Remove the trailing ", "
results
[
job
][
"time_spent"
]
=
results
[
job
][
"time_spent"
][:
-
2
]
results
[
job
][
"time_spent"
]
=
results
[
job
][
"time_spent"
][:
-
2
]
...
...
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