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 8 additions and 1 deletions
Showing only changes of commit 3d46c4b60a - Show all commits
+2 -1
View File
@@ -100,7 +100,8 @@ jobs:
--output "$FINDINGS_FILE" --output "$FINDINGS_FILE"
- name: Tell the author - name: Tell the author
if: ${{ always() && gitea.event_name == 'pull_request' }} # in a called workflow gitea.event_name is workflow_call, so ask for the pull request itself
if: ${{ always() && gitea.event.pull_request.number != '' }}
continue-on-error: true continue-on-error: true
env: env:
GITEA_API_URL: ${{ gitea.api_url }} GITEA_API_URL: ${{ gitea.api_url }}
+6
View File
@@ -262,6 +262,12 @@ class TestWorkflow:
assert tell["continue-on-error"] is True and "always()" in tell["if"] assert tell["continue-on-error"] is True and "always()" in tell["if"]
assert "steps.check.outcome == 'failure'" in steps["Fail the run when a comment is not in English"]["if"] assert "steps.check.outcome == 'failure'" in steps["Fail the run when a comment is not in English"]["if"]
def test_the_author_step_asks_for_the_pull_request_not_for_the_event_name(self, document):
# in a called workflow gitea.event_name is workflow_call (seen on the instance, MIL-013 task 8)
tell = next(s for s in document["jobs"]["english-comments"]["steps"] if s.get("name") == "Tell the author")
assert "event_name" not in tell["if"]
assert "gitea.event.pull_request.number != ''" in tell["if"]
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", "")