Skip to content
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 reporter #1447

Merged
merged 1 commit into from
May 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 23 additions & 20 deletions utils/log_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
log.unlink()

message = ""
all_files2failed = []
if total_num_failed > 0:
for name, num_failed, failed_tests in group_info:
if num_failed > 0:
Expand Down Expand Up @@ -85,6 +86,7 @@
stralign="right",
)
message += f"\n```\n{failed_table}\n```"
all_files2failed.append(files2failed)
if len(message) > 3000:
err = "Too many failed tests, please see the full report in the Action results."
offset = len(err) + 10
Expand Down Expand Up @@ -137,25 +139,26 @@
payload.append(date_report)
response = client.chat_postMessage(channel="#accelerate-ci-daily", text=message, blocks=payload)
ts = response.data["ts"]
for test_location, test_failures in files2failed.items():
# Keep only the first instance of the test name
test_class = ""
for i, row in enumerate(test_failures):
if row[0] != test_class:
test_class = row[0]
else:
test_failures[i][0] = ""
for failed_file in all_files2failed:
for test_location, test_failures in failed_file.items():
# Keep only the first instance of the test name
test_class = ""
for i, row in enumerate(test_failures):
if row[0] != test_class:
test_class = row[0]
else:
test_failures[i][0] = ""

payload = {
"type": "section",
"text": {
"type": "mrkdwn",
"text": f"Test location: {test_location}\n```\n{tabulate(test_failures, headers=['Class', 'Test'], tablefmt=hf_table_format, stralign='right')}\n```",
},
}
payload = {
"type": "section",
"text": {
"type": "mrkdwn",
"text": f"Test location: {test_location}\n```\n{tabulate(test_failures, headers=['Class', 'Test'], tablefmt=hf_table_format, stralign='right')}\n```",
},
}

client.chat_postMessage(
channel="#accelerate-ci-daily",
thread_ts=ts,
blocks=[payload],
)
client.chat_postMessage(
channel="#accelerate-ci-daily",
thread_ts=ts,
blocks=[payload],
)