Skip to content

test(cli): remove the config test directories when each test ends - #792

Merged
ajianaz merged 3 commits into
developfrom
test/testdir-config
Nov 15, 2026
Merged

ajianaz merged 3 commits into
developfrom
test/testdir-config

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What

The config, project-trust, sensitive-config and apply tests (unit and end-to-end) use TestDir instead 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 in src/config/ (apply_tests, project_trust_tests, mod, profile, routing_tests): the hand-built temp_dir().join(format!(..)) + counter helpers return a TestDir (from test: add a self-removing TestDir helper for the test suites #789); the counters go.
  • Helpers that returned a path derived from a scratch directory (the trust store, the routing session) now return or own the guard, so the directory lives as long as the test uses it.
  • 9 files, 88 added and 111 removed lines.

Testing

  • Private TMPDIR, config family only (config_sensitive, config_trust, config_check, config_apply and config:: unit tests, 147 + 60 tests): before 330 new entries (183 tole-sens-e2e, 56 tole-apply-e2e, 51 tole-trust, 12 tole-apply, 10 tole-cfg-e2e, 8 tole-trust-e2e, ...), after 0.
  • cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings: clean.

Refs #781

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.
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit e9a501a into develop Nov 15, 2026
22 checks passed
@ajianaz
ajianaz deleted the test/testdir-config branch November 20, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants