Give tests/pi-provider.sh one function per case #65
No reviewers
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/nexus!65
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/pi-provider-test-cases"
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/pi-provider.shnow has one function per case, run from the same runner its sibling tests use, so a failing scenario is named rather than being a line number into a fifteen-hundred-line straight-line script. Every assertion is preserved: the multiset of all 440 assertion calls is identical before and after, and the suite passes with the same 336 assertions as master. Nothing outside this one test file changes. If it is wrong, revert the one commit.What changed
run_testcalls, each scenario opening with its own fixture setup. The prose comment that introduced each scenario is its function's header.setup_fixture(327 lines) is split into itself andwrite_fixture_command_stubs, the eight sabotage-capable command stubs, written with the same content and mode.tests/nexus-host-key.shandtests/refresh-local-auth.sh: the case runs in a subshell that sets-eitself and its status is read as a plain statement, never from anifcondition, pershell.md.$TEST_ROOT, and the leak-scan case, registered last, reads them from there. Inside$TEST_ROOTthe scan flagged its own log as a leak, which is why it lives outside.Risk
R2. One test file; no production script or module changes. The failure modes are an assertion that now checks a freshly generated value where it used to check one an earlier scenario produced, and the on-disk bookkeeping letting the leak scan pass vacuously; the review below was asked to enumerate both. Rollback is a straight revert.
Validation
assert_*,passandfailcall's source text extracted from both versions, whitespace-normalized and sorted: identical, 440 calls. The integrator independently compared per-helper call counts on master and the branch:assert_contains97,assert_missing12,assert_json40,assert_ciphertext23,assert_undecryptable4,pass85,fail119, all equal.bash -nandshellcheck -x --source-path=SCRIPTDIR, exactly as the flake check invokes them: clean, re-run by the integrator.bash tests/pi-provider.shfrom the worktree root, re-run by the integrator: exit 0, noFAILline,pi-provider tests passed: 336 assertions, the same count as master.falseinserted mid-case between apassand the case's final assertion is reportedFAILby the runner and stops the suite with exit 1; removed, the file is byte-identical to the committed version.provisioning-contractflake check that wraps every test intests/, since it builds the provisioning scripts package; the same lint and the same test invocation were run directly with the same tools from the VM's profile.gpt-5.6-terraon codex, high effort), asked specifically about cross-case state, the bookkeeping directory, the runner'sset -ehandling, the two long cases and the moved stubs: no findings (transcript of 732 KB; an empty review was ruled out before it was read as approval).Closes allod/nexus#64