Skip to content

fix: stop tests from leaking temp directories - #65

Merged
yordis merged 1 commit into
mainfrom
yordis/fix-cli-test-tempdir-leak
Oct 11, 2026
Merged

yordis merged 1 commit into
mainfrom
yordis/fix-cli-test-tempdir-leak

Conversation

@yordis

@yordis yordis commented Oct 11, 2026 •

Copy link
Copy Markdown
Member
  • Every CLI integration test and several server/client unit tests minted their own temp directory by hand under std::env::temp_dir() and never removed it, so each test run left more directories behind than it started with
  • A handful of these also named the directory from a weak key (bare process id, or a pid+timestamp pair a fast test run can repeat), so two tests could collide on the same path instead of just leaking separately

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@cursor

cursor Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Test-only refactoring with no changes to server, CLI, or client runtime code.

Overview
Replaces hand-rolled temp directories under std::env::temp_dir() in CLI, client, and server tests with the workspace tempfile dependency (tempfile = "3"), wired in as dev-dependencies where needed.

Test helpers now return tempfile::TempDir (with stable trogon-atlas-* prefixes) instead of PathBuf paths built from pid/timestamp/uuid_like(); call sites use .path() / .path().join(...). Manual create_dir_all and remove_dir_all cleanup is removed so directories are deleted when the guard drops—addressing leaks and weak uniqueness that could cause path collisions on fast parallel runs.

No production/runtime behavior changes; only test harness and lockfile/Cargo wiring.

Reviewed by Cursor Bugbot for commit df8873e. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 46 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 35e1a8a2-d325-4b0c-9cef-2f531de190be

📥 Commits

Reviewing files that changed from the base of the PR and between e02d43f and df8873e.


⛔ Files ignored due to path filters (1)
  • rsworkspace/Cargo.lock is excluded by !**/*.lock

📒 Files selected for processing (15)
  • rsworkspace/Cargo.toml
  • rsworkspace/crates/trogon-atlas-cli/Cargo.toml
  • rsworkspace/crates/trogon-atlas-cli/tests/branch_cli_integration.rs
  • rsworkspace/crates/trogon-atlas-cli/tests/export_cli_integration.rs
  • rsworkspace/crates/trogon-atlas-cli/tests/fmt_integration.rs
  • rsworkspace/crates/trogon-atlas-cli/tests/format_cli_integration.rs
  • rsworkspace/crates/trogon-atlas-cli/tests/mixed_version_cli.rs
  • rsworkspace/crates/trogon-atlas-cli/tests/operation_cli_integration.rs
  • rsworkspace/crates/trogon-atlas-client/Cargo.toml
  • rsworkspace/crates/trogon-atlas-client/src/manifest.rs
  • rsworkspace/crates/trogon-atlas-server/Cargo.toml
  • rsworkspace/crates/trogon-atlas-server/src/auth.rs
  • rsworkspace/crates/trogon-atlas-server/src/git_mirror.rs
  • rsworkspace/crates/trogon-atlas-server/src/token_reload.rs
  • rsworkspace/crates/trogon-atlas-server/tests/phase8_git_mirror.rs

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit df8873e. Configure here.

Comment thread rsworkspace/crates/trogon-atlas-cli/tests/branch_cli_integration.rs
@yordis
yordis merged commit c968fd5 into main Oct 11, 2026
27 checks passed
@yordis
yordis deleted the yordis/fix-cli-test-tempdir-leak branch October 11, 2026 06:58
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.

1 participant