Give tests/pi-provider.sh one function per case #64
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#64
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?
Bring
tests/pi-provider.shup to the standard its siblings already meet: one function per case, so a failing case is named by a function and a reader can find a scenario without scrolling fifteen hundred lines of straight-line shell.Primary goals:
tests/nexus-host-key.shandtests/refresh-local-auth.share written.setup_fixtureis broken into the pieces the cases actually share, so a case can say which fixture it needs.assert_*andpass/failcalls before and after is the same, which is what shows nothing was dropped in the move.Current state and specifics
The file is 2135 lines with 20 functions, all of them helpers:
setup_fixture(tests/pi-provider.sh:82-409),setup_legacy_fixture(:410-437), sevenrun_provider_*wrappers (:438-558) and the assertion helpers. Everything from:574to the end, about 1560 lines, is one straight-line sequence of cases delimited only by prose comments ("Open-world adapters and model fields, on its own fixture…", "Recovery itself can die after recreating a pruned directory…"). The siblings show the target shape:tests/nexus-host-key.shis 962 lines in 43 functions andtests/refresh-local-auth.shis 823 lines in 31, each case a function.shell.mdhas the one rule that matters for the runner: a case body must run in a subshell that sets-eitself and reports its status as a plain statement, becauseif run_case; thensuspendsset -efor the whole function and turns a failed assertion in the middle into a pass.Scope
In scope: the case functions, the runner, and the fixture split.
Explicitly not in scope: changing what any case asserts, and the other tests in
tests/, which already have the shape.