Repository navigation
feat(test-infrastructure): keep test temp files under one run root - #698
simonheimlicher wants to merge 5 commits into
Conversation
The decision now keeps every temp file and directory a test run creates under one run root in the worktree. The run creates the root before its first test, points the temp location and the Git ceiling at it, removes it when the run ends, sweeps roots a killed run left, and keeps no tmp_path directory after a test ends. Verification: not-run Refs: spx/15-test-language.adr.md
The Node declares that a pytest run keeps every temp file under one run root in its worktree: the user temp folder is unchanged after a run, the temp location and the Git ceiling point at the root, a later run sweeps roots a killed run left, and no tmp_path directory outlives its test. The assertions await verification selection. Verification: not-run Refs: spx/13-infrastructure.enabler/21-test-infrastructure.enabler
The five run temp root assertions carry their test links, grouped under the scenario and compliance headings. The scenario assertion links the scenario test, and the four rules link the compliance test. Verification: not-run Refs: spx/13-infrastructure.enabler/21-test-infrastructure.enabler
A pytest plugin creates one run root under .spx/worktree/test-runs/ in the worktree before the first test. It sweeps roots a killed run left, points the temp location and the Git ceiling at the new root, removes each tmp_path directory after its test, and removes the root and restores the environment when the run ends. The root conftest registers the plugin. An observation harness runs a fixture module in a scratch worktree and returns what the run left behind. Verification: not-run Refs: spx/13-infrastructure.enabler/21-test-infrastructure.enabler
The scenario test shows a run with a passing and a failing test leaves the user temp folder as it found it. The compliance tests show the run root location and environment, the Git ceiling, the sweep that stays inside the worktree, and the removal of each tmp_path directory. Verification: not-run Refs: spx/13-infrastructure.enabler/21-test-infrastructure.enabler
BLOCKING [consistency]: outcomeeng_testing/harnesses/run_temp_root.py:63Reference: BLOCKING [consistency]: outcomeeng_testing/harnesses/run_temp_root.py:92Reference: |
|



Summary
Background
Test runs left directories and files in the user temp folder, and a killed run left them there for good. The amended test-language decision rules that each run owns one root, that every temp path reaches it, that Git never searches above it, that a later run sweeps stale roots in its own worktree, and that no test retains a temp path.
Changes
spx/15-test-language.adr.md: five rules for the run-scoped temp root, its reach, its Git ceiling, the stale-root sweep, and the ban on retained temp paths.spx/13-infrastructure.enabler/21-test-infrastructure.enabler/test-infrastructure.md: five assertions, each linked to its test.outcomeeng_testing/harnesses/run_temp_root.py: a pytest plugin that creates the run root under.spx/worktree/test-runs/, points the temp location and the Git ceiling at it, sweeps stale roots, removes eachtmp_pathdirectory after its test, and restores the environment at run end.conftest.py: registers the plugin.outcomeeng_testing/harnesses/run_temp_root_observation.pyandoutcomeeng_testing/fixtures/run_temp_root/case_temp_runs.py: run a fixture module under pytest in a scratch worktree and return what the run left behind.tests/directory: one scenario and one compliance file.Test plan
just test spx/13-infrastructure.enabler/21-test-infrastructure.enabler/tests/passes.just checkpasses on the head.spx validation markdown,just eval-linksandspx spec status --format jsonpass.Known gap
The recipe runner in
outcomeeng/validation/_engine.pywritesoutcomeeng-validation-summary-<recipe>-<id>.jsonto the user temp folder withdelete=Falsebefore pytest starts, and a failing step leaves its log there. This changeset does not touch the runner. Read-only check:ls /var/folders/vg/stx1n5ys4_lgr08v49lg6t880000gp/T/ | grep outcomeeng-validation-summary.Validation
Refs
Need help on this PR? Tag
@codesmith-botwith what you need.