-
Notifications
You must be signed in to change notification settings - Fork 27.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix CI slack reporting issue #34833
Fix CI slack reporting issue #34833
Conversation
lines = exception_message.split("\n") | ||
# Add a first line with more informative information instead of just `= test session starts =`. | ||
# This makes the `short test summary info` section more useful. | ||
if "= test session starts =" in lines[0]: | ||
text = "" | ||
for line in lines[1:]: | ||
if line.startswith("FAILED "): | ||
text = line[len("FAILED ") :] | ||
text = "".join(text.split(" - ")[1:]) | ||
elif line.startswith("=") and line.endswith("=") and " failed in " in line: | ||
break | ||
elif len(text) > 0: | ||
text += f"\n{line}" | ||
text = "(subprocess) " + text | ||
lines = [text] + lines | ||
exception_message = "\n".join(lines) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently, what is shown in the (final) short test summary info
is something like
/transformers/src/transformers/testing_utils.py:2420: ==== test session starts ====
which is not very informative.
And for the same test, we get two FAILED
in the log: one from the subprocess
and another one is the original pytest process. This causes slack CI report script fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah got it thanks for explaining
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TY!
lines = exception_message.split("\n") | ||
# Add a first line with more informative information instead of just `= test session starts =`. | ||
# This makes the `short test summary info` section more useful. | ||
if "= test session starts =" in lines[0]: | ||
text = "" | ||
for line in lines[1:]: | ||
if line.startswith("FAILED "): | ||
text = line[len("FAILED ") :] | ||
text = "".join(text.split(" - ")[1:]) | ||
elif line.startswith("=") and line.endswith("=") and " failed in " in line: | ||
break | ||
elif len(text) > 0: | ||
text += f"\n{line}" | ||
text = "(subprocess) " + text | ||
lines = [text] + lines | ||
exception_message = "\n".join(lines) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah got it thanks for explaining
* fix * fix * fix * fix * fix --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
* fix * fix * fix * fix * fix --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
What does this PR do?
#34812 causes the slack report fail to be sent.
This PR fixes this issue (a bit hacky)