rotate-token test suite enforces only the last assertion of each test #46
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#46
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?
tests/rotate-token.shenforces only the last command of each test function; every earlier[[ ... ]]assertion is a no-op, so most of the suite cannot fail on the properties it names.Evidence
run_test(tests/rotate-token.sh:11-21) invokes each test asif "$@"; then. Bash ignoresset -einside anifcondition, and that extends into any function called there, so a failed[[ ... ]]mid-function continues to the next line and the function's status is whatever its last command returns.Minimal reproduction of the semantics:
Running the suite on
masterwith an enforcing harness (set +e; ( set -e; "$@" ); status=$?; set -ein place ofif "$@") stops at the sixth test:The suite exits on the first failure, so the total number of tests whose non-final assertions do not hold on
masteris unknown; at least one does not.nix build .#checks.x86_64-linux.provisioning-contractruns this suite and reports success today.Affected: every test in
tests/rotate-token.shwith more than one assertion;flake.nixprovisioning-contract. Observed on themasterat0f0fa2b. Found while adding tests for allod/nexus#42; those new tests carry|| return 1on each assertion so they hold under the current harness, but the rest of the suite is unchanged.Labels are unavailable to the filing token; this is a
bugreport.