Skip to content

Commit

Permalink
Fix: verifyruns
Browse files Browse the repository at this point in the history
  • Loading branch information
S1ro1 authored and ngc92 committed Jan 19, 2025
1 parent f2da0d0 commit 5e773dc
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/discord-cluster-manager/cogs/verify_run_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async def verify_github_run(
interaction: discord.Interaction,
lang: str,
) -> bool:
github_command = github_cog.run_submission
github_command = github_cog.submit_leaderboard
if lang == "py":
sub_code = create_mock_attachment(
"submission.py", Path("examples/identity_py/submission.py").read_text()
Expand All @@ -55,13 +55,16 @@ async def verify_github_run(
)
ref_code = Path("examples/identity_cuda/reference.cuh").read_text()

github_thread, result = await github_command.callback(
github_cog, interaction, sub_code, choice, reference_code=ref_code
github_thread, _ = await github_command(
interaction,
sub_code,
choice,
ref_code,
)

message_contents = [msg.content async for msg in github_thread.history(limit=None)]

required_patterns = ["Processing `.*` with", "Running on GitHub...", "'check': 'pass'"]
required_patterns = ["Running on GitHub...", "'check': 'pass'"]

all_patterns_found = all(
any(re.search(pattern, content, re.DOTALL) is not None for content in message_contents)
Expand Down Expand Up @@ -93,7 +96,7 @@ async def verify_modal_run(
self, modal_cog: ModalCog, interaction: discord.Interaction, lang: str
) -> bool:
t4 = app_commands.Choice(name="T4", value="t4")
modal_command = modal_cog.run_submission
modal_command = modal_cog.submit_leaderboard

if lang == "py":
sub_code = create_mock_attachment(
Expand All @@ -106,8 +109,11 @@ async def verify_modal_run(
)
ref_code = Path("examples/identity_cuda/reference.cuh").read_text()

modal_thread, result = await modal_command.callback(
modal_cog, interaction, sub_code, t4, reference_code=ref_code
modal_thread, _ = await modal_command(
interaction,
sub_code,
t4,
reference_code=ref_code,
)

message_contents = [msg.content async for msg in modal_thread.history(limit=None)]
Expand Down

0 comments on commit 5e773dc

Please sign in to comment.