Repository navigation
ci: fail the Test job when the suites leave tole-* or cora-* directories behind - #800
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.
…ies behind Refs #781. Runs cargo test with a private TMPDIR and checks it, and cargo's target/tmp, for leftovers. Documents TestDir in CONTRIBUTING.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Nov 17, 2026
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 CI Test job runs
cargo test --workspacewith a fresh privateTMPDIRand fails when atole-*orcora-*entry is still there afterwards. DocumentsTestDirin CONTRIBUTING.Why
Closes #781. Without a guard the leak comes back with the next test written the old way.
Changes
.github/workflows/ci.yml, Test job (existing steps kept): a step that makes/tmp/tole-test-tmp.XXXXXX(viamktemp) and clearstarget/tmp;TMPDIRis set for thecargo teststep only; a final step liststole-*/cora-*entries directly under that directory and undertarget/tmp(where the integration tests keep theirs) and fails with the first 50 names. Fixedshared-*fixtures are not counted./tmp, notRUNNER_TEMP: the runner temp dir sits inside$HOME(/home/runner/work/_temp), and the sandbox tests refuse a workspace under$HOME(verified locally: withTMPDIRunder$HOMEthe sandbox unit tests fail).CONTRIBUTING.md: a bullet onTestDir,ChildGuard,TOLE_KEEP_TEST_DIRS=1and the CI check.Testing
cargo test --workspacewith a privateTMPDIR(2267 tests, 0 failures);TMPDIRholds 0tole-*/cora-*entries (baseline before the series: 1385 entries, 148 MB, plus 1 intarget/tmp);target/tmpholds onlyshared-*directories. The check command was also run by hand against a directory holdingtole-x,otherandshared-y: it reports onlytole-x.find(well under a second); test time summed over all binaries was 219 s before and 225 s after (noise level, the tests now also remove their directories). The CI run of this PR gives the real number.ci.ymlparses as YAML.Closes #781