Make rotate-token's test runner enforce every assertion #48
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/nexus#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?
Make every assertion in
tests/rotate-token.shcount, so the suite can fail on the properties it names instead of only on each test's last line (the defect in allod/nexus#46).Primary goals:
run_testruns each test in a context where a failed command ends the test: a subshell that sets-eitself, with the status read outside anyifor||, so bash's rule that suspends-einside conditions no longer reaches the test body.read -pprints no prompt when stdin is not a terminal, so no assertion on prompt text can pass or fail for a reason; those assertions go, or are reshaped to observe the effect of the prompt instead.Current state and specifics
run_test(tests/rotate-token.sh:11-21) isif "$@"; then PASS else FAIL; exit 1. Under an enforcing runner onmasterthe sixth test, "in-place continuity dry-run orders refresh before network steps", fails, and the suite stops there, so the number of affected tests is unknown until the runner is fixed. The six tests added in allod/nexus#47 end every assertion with|| return 1and are already enforced; they stay as they are.The suite runs in the
provisioning-contractflake check, so the fixed runner and every corrected test must pass there as well as locally.Scope
In:
run_test, the tests whose assertions were vacuous, andscripts/rotate-tokenonly where a corrected assertion exposes a small, unambiguous script defect.Out: new coverage, restructuring the suite, and any script change whose intent the failing test does not settle; those are reported in the PR for separate issues.