Repository navigation
test(cli): remove the config test directories when each test ends - #792
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. The config, trust, sensitive-config and apply tests (unit and end-to-end) build their directories with TestDir instead of leaking tole-sens-e2e-*, tole-trust-*, tole-apply-*, tole-cfg-e2e-*, tole-config-*, tole-profile-* and tole-routing-* entries.
🔍 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 config, project-trust, sensitive-config and apply tests (unit and end-to-end) use
TestDirinstead of leaking their directories. No production code changes.Why
Refs #781. These families were the biggest leakers:
tole-sens-e2e-*(23 166 of the 175 000),tole-trust-*,tole-apply-*,tole-cfg-e2e-*,tole-config-*,tole-profile-*,tole-routing-*.Changes
tests/config_sensitive.rs,config_trust.rs,config_check.rs,config_apply.rs, and the unit tests insrc/config/(apply_tests,project_trust_tests,mod,profile,routing_tests): the hand-builttemp_dir().join(format!(..))+ counter helpers return aTestDir(from test: add a self-removing TestDir helper for the test suites #789); the counters go.Testing
TMPDIR, config family only (config_sensitive,config_trust,config_check,config_applyandconfig::unit tests, 147 + 60 tests): before 330 new entries (183tole-sens-e2e, 56tole-apply-e2e, 51tole-trust, 12tole-apply, 10tole-cfg-e2e, 8tole-trust-e2e, ...), after 0.cargo fmt --all,cargo clippy --workspace --all-targets -- -D warnings: clean.Refs #781