Skip to content

Commit 6a296f8

Browse files
committed
better summary message for submit test/benchmark
1 parent 8322792 commit 6a296f8

2 files changed

Lines changed: 41 additions & 31 deletions

File tree

src/discord-cluster-manager/cogs/submit_cog.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from consts import SubmissionMode
1010
from discord import app_commands
1111
from discord.ext import commands
12-
from report import MultiProgressReporter, RunProgressReporter, generate_report, private_run_report
12+
from report import MultiProgressReporter, RunProgressReporter, generate_report, make_short_report
1313
from run_eval import FullResult
1414
from task import LeaderboardTask
1515
from utils import build_task_config, send_discord_message, setup_logging, with_error_handling
@@ -150,12 +150,11 @@ async def _handle_submission(
150150
else:
151151
await reporter.update_title(reporter.title + " ✅ success")
152152

153-
if mode == SubmissionMode.PRIVATE:
154-
await reporter.push(private_run_report(result.runs))
155-
else:
156-
if mode == SubmissionMode.LEADERBOARD:
157-
await reporter.push(private_run_report(result.runs))
158-
153+
await reporter.push(make_short_report(
154+
result.runs,
155+
full=mode in [SubmissionMode.PRIVATE, SubmissionMode.LEADERBOARD])
156+
)
157+
if mode != SubmissionMode.PRIVATE:
159158
try:
160159
await generate_report(thread, result.runs)
161160
await reporter.push(f"See results at {thread.jump_url}")

src/discord-cluster-manager/report.py

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ async def _generate_test_report(thread: discord.Thread, run: RunResult):
112112
return
113113

114114

115-
def private_run_report(runs: dict[str, EvalResult]) -> list[str]: # noqa: C901
115+
def make_short_report(runs: dict[str, EvalResult], full=True) -> list[str]: # noqa: C901
116116
"""
117117
Creates a minimalistic report for `runs`,
118118
returned as a list of status strings
@@ -128,31 +128,42 @@ def private_run_report(runs: dict[str, EvalResult]) -> list[str]: # noqa: C901
128128
if any_compile:
129129
result.append("✅ Compilation successful")
130130

131-
if "test" not in runs or not runs["test"].run.success:
132-
result.append("❌ Running tests failed")
133-
return result
134-
elif not runs["test"].run.passed:
135-
result.append("❌ Testing failed")
136-
return result
137-
else:
138-
result.append("✅ Testing successful")
139-
140-
if "benchmark" not in runs or not runs["benchmark"].run.success:
141-
result.append("❌ Running benchmarks failed")
142-
return result
143-
elif not runs["benchmark"].run.passed:
144-
result.append("❌ Benchmarking failed")
145-
return result
146-
else:
147-
result.append("✅ Benchmarking successful")
131+
if "test" in runs:
132+
test_run = runs["test"].run
133+
if not test_run.success:
134+
result.append("❌ Running tests failed")
135+
return result
136+
elif not test_run.passed:
137+
result.append("❌ Testing failed")
138+
return result
139+
else:
140+
result.append("✅ Testing successful")
141+
elif full:
142+
result.append("❌ Tests missing")
148143

149-
if "leaderboard" not in runs or not runs["leaderboard"].run.success:
150-
result.append("❌ Running leaderboard failed")
151-
elif not runs["leaderboard"].run.passed:
152-
result.append("❌ Leaderboard run failed")
153-
else:
154-
result.append("✅ Leaderboard run successful")
144+
if "benchmark" in runs:
145+
bench_run = runs["benchmark"].run
146+
if bench_run.success:
147+
result.append("❌ Running benchmarks failed")
148+
return result
149+
elif not bench_run.passed:
150+
result.append("❌ Benchmarking failed")
151+
return result
152+
else:
153+
result.append("✅ Benchmarking successful")
154+
elif full:
155+
result.append("❌ Benchmarks missing")
155156

157+
if "leaderboard" in runs:
158+
lb_run = runs["leaderboard"].run
159+
if not lb_run.success:
160+
result.append("❌ Running leaderboard failed")
161+
elif not lb_run.passed:
162+
result.append("❌ Leaderboard run failed")
163+
else:
164+
result.append("✅ Leaderboard run successful")
165+
elif full:
166+
result.append("❌ Leaderboard missing")
156167
return result
157168

158169

0 commit comments

Comments
 (0)