Repository navigation
test(core): remove the integration-test directories when each test ends - #799
Merged
Merged
Conversation
Refs #781. Adds TestDir (unique scratch directory removed on drop, also on panic, robust to read-only trees, TOLE_KEEP_TEST_DIRS=1 and keep() escape hatches) and ChildGuard (kill and reap a child before its directory goes) to tole-core and tole-cli, for integration tests and unit tests. No test is converted yet.
Refs #781. WorkDir creates <root>/w inside a TestDir, so work.with_extension("home") lands in the same removed root.
Refs #781. Process-wide fixtures that no per-test guard can own (the mcp sandbox out root, the command sandbox tree) keep one fixed shared-* directory under the target tmp dir instead of a new one per run.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The
tole-coreintegration tests (tests/*.rs, including the mcp sandbox tests and theirsupportmodule) useTestDir(from #789) instead of leaking their directories. No production code changes.Why
Refs #781:
cora-e2-*,cora-e3-*,cora-e5-*,tole-gate-*,tole-sbx-life-*,tole-batch-*,tole-fuzz-*,tole-perf-*,tole-lock-*and the rest left a directory per test per run (thecora-*entries of the report).Changes
crates/tole-core/tests. Gate and hook marker files that were temp paths (tole-gate-count-*and friends) become files inside a guard; the gate hook helper returns its guard.shared-*directory under cargo's target tmp instead of a new one per run: the mcp sandboxout_root(shared-sbx-root, its per-test subdirectories are recreated by name) and the command sandbox tree (shared-cmdsbx, emptied on init). Neither istole-*.TestDirs held by the tests.Testing
cargo test --workspacewith a privateTMPDIRand the whole series applied: 2267 tests pass, 0tole-*/cora-*entries inTMPDIRortarget/tmp(only the fixedshared-*directories).cargo fmt --all,cargo clippy --workspace --all-targets -- -D warnings, and-p tole-core --no-default-features --tests: clean.Refs #781