Fix three defects of the English-comments check found in the trial (task 8) #212

Merged
Tirsvad merged 3 commits from mil-013-judge-each-line into main 2026-10-21 05:47:53 +02:00
2 changed files with 6 additions and 1 deletions
Showing only changes of commit 39bcaa5bac - Show all commits
+1 -1
View File
@@ -108,7 +108,7 @@ jobs:
SOURCE_REPOSITORY: ${{ gitea.repository }} SOURCE_REPOSITORY: ${{ gitea.repository }}
PR_NUMBER: ${{ gitea.event.pull_request.number }} PR_NUMBER: ${{ gitea.event.pull_request.number }}
PR_AUTHOR: ${{ gitea.event.pull_request.user.login }} PR_AUTHOR: ${{ gitea.event.pull_request.user.login }}
RUN_URL: ${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_number }} RUN_URL: ${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}
REPORT_TOKEN: ${{ secrets.REPORT_TOKEN || gitea.token }} REPORT_TOKEN: ${{ secrets.REPORT_TOKEN || gitea.token }}
run: python3 shared-scripts/tools/english_comments_report.py run: python3 shared-scripts/tools/english_comments_report.py
+5
View File
@@ -268,6 +268,11 @@ class TestWorkflow:
assert "event_name" not in tell["if"] assert "event_name" not in tell["if"]
assert "gitea.event.pull_request.number != ''" in tell["if"] assert "gitea.event.pull_request.number != ''" in tell["if"]
def test_the_link_to_the_run_uses_the_run_id(self, document):
# the URL of a run on the instance holds its id, not its number (MIL-013 task 8)
tell = next(s for s in document["jobs"]["english-comments"]["steps"] if s.get("name") == "Tell the author")
assert tell["env"]["RUN_URL"].endswith("/actions/runs/${{ gitea.run_id }}")
def test_inputs_reach_the_scripts_as_environment_variables_only(self, document): def test_inputs_reach_the_scripts_as_environment_variables_only(self, document):
for step in document["jobs"]["english-comments"]["steps"]: for step in document["jobs"]["english-comments"]["steps"]:
assert "inputs." not in step.get("run", "") assert "inputs." not in step.get("run", "")