test: No action's behaviour is covered by anything that runs again #48
Labels
No labels
priority/P0
priority/P1
priority/P2
priority/P3
size/L
size/M
size/S
size/XL
size/XS
state/done
state/in-progress
state/in-review
state/needs-refinement
state/ready
type/bug
type/chore
type/feature
type/refactor
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
amtronics/platform-actions#48
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
check-actions.pyparses everyaction.yml, checks the fields a composite action needs, and runsbash -nover eachrun:body with${{ }}substituted. It cannot execute one, so no action's behaviour is tested by anything that runs again.Every recent change here has been verified by hand, by extracting a
run:body into a file, stubbing the commands it calls, and driving it through its cases:Each of those found something a reading would not have: a
|| echo 000that concatenated with curl's own000to give000000, a mutation that was a syntax error rather than a behavioural change, and an unguardedcurlreportingHTTPwith an empty status. None of that verification survives the pull request it was written in.This is the repository whose
v3tag every other repository consumes, and a change here reaches all of them unexecuted — the README says as much. Hand verification that is discarded is the weakest possible answer to that.Scope
run:bodies against stubbed commands and asserts on output and exit status, plus the existing verifications forrelease,report-job-failureanddeploy-vpswritten into it.Acceptance criteria
run:body, when the harness runs, then that body can be executed with named commands stubbed and its stdout, stderr and exit status asserted.deploy-vpsthat refuses an undeclared profile, when the harness runs, then all four of its states are covered.check-actions.py.Notes
The third criterion is the one that matters and the one most likely to be quietly skipped. Every verification listed above was written by first watching the case fail against the unfixed code; a harness that only ever ran against working code would have recorded four passing tables and caught none of the four defects.
Extraction is the fiddly part: a
run:body inside a heredoc keeps the heredoc's indentation, sotextwrap.dedenton the YAML-parsed string is not always enough — thedeploy-vpsguard had to be pulled from the raw file by line range. Worth solving once in the harness rather than in each verification.check-actions.pyalready substitutes${{ }}and knows how to find every action; the harness should reuse that rather than reimplement it.