Skip to content

[nextest-runner] store records in the state dir, not the cache dir#3043

Merged
sunshowers merged 1 commit into
mainfrom
state-dir
Feb 4, 2026
Merged

[nextest-runner] store records in the state dir, not the cache dir#3043
sunshowers merged 1 commit into
mainfrom
state-dir

Conversation

@sunshowers

@sunshowers sunshowers commented Feb 4, 2026

Copy link
Copy Markdown
Member

The state dir is a more reasonable place to put records, since they're not regenerable.

Also add a migration path. This won't affect too many folks but I want to put it in place while the impact is minimal. I'll remove the migration soon.

Copilot AI 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.

Pull request overview

This PR migrates nextest's test run recordings from the cache directory to the state directory, which is more semantically appropriate since recordings represent accumulated state that cannot be regenerated, not cache data.

Changes:

  • Renamed records_cache_dir to records_state_dir and moved from cache_dir.rs to state_dir.rs
  • Renamed CacheDirError to StateDirError and updated all error messages
  • Added automatic one-time migration from ~/.cache/nextest/ to ~/.local/state/nextest/ on Unix systems
  • Updated all references across the codebase including internal tools and integration tests

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
site/src/docs/features/record-replay-rerun.md Updated documentation to reflect new state directory location
nextest-runner/src/record/state_dir.rs Renamed from cache_dir.rs; added migration logic and comprehensive tests
nextest-runner/src/record/session.rs Updated to use records_state_dir and state_dir terminology
nextest-runner/src/record/mod.rs Updated module declarations and exports
nextest-runner/src/errors.rs Renamed CacheDirError to StateDirError and updated error messages
internal-tools/zstd-dict/src/main.rs Updated internal tool to use state directory logic
integration-tests/tests/integration/record_replay.rs Updated test comments and documentation
cargo-nextest/src/errors.rs Updated error type references
cargo-nextest/src/dispatch/utility/store.rs Updated to use records_state_dir
cargo-nextest/src/dispatch/core/run.rs Updated to use records_state_dir
cargo-nextest/src/dispatch/core/replay.rs Updated to use records_state_dir

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread site/src/docs/features/record-replay-rerun.md Outdated
@codecov

codecov Bot commented Feb 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.71975% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.01%. Comparing base (437f0f4) to head (3259b36).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
nextest-runner/src/record/state_dir.rs 93.02% 9 Missing ⚠️
cargo-nextest/src/errors.rs 0.00% 2 Missing ⚠️
nextest-runner/src/record/session.rs 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3043      +/-   ##
==========================================
+ Coverage   83.98%   84.01%   +0.02%     
==========================================
  Files         154      154              
  Lines       41768    41873     +105     
==========================================
+ Hits        35079    35178      +99     
- Misses       6689     6695       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The state dir is a more reasonable place to put records, since they're not regenerable.

Also add a migration path. This won't affect too many folks but I want to put it in place while the impact is minimal.
@sunshowers sunshowers merged commit 3ef3059 into main Feb 4, 2026
21 checks passed
@sunshowers sunshowers deleted the state-dir branch February 4, 2026 22:36
@trunk-io

trunk-io Bot commented Feb 5, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

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