desktop: cargo test --release fails to compile (storage_tests.rs uses debug_assertions-gated items without cfg gates)
- Dominant language
- Rust
- Stars
- 32.7k
- Forks
- 4.3k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 253
Description
## Problem
`cargo test --release` in `desktop/src-tauri` fails to compile with 11 E0425 errors. `src/managed_agents/storage_tests.rs` references `copy_agent_keys_between_stores` (storage.rs:515) and `DEV_MIGRATION_MARKER` (storage.rs:494), both `#[cfg(debug_assertions)]`, but the referencing tests carry no matching cfg gate (the only cfgs in storage_tests.rs are `#[cfg(unix)]` at :325 and :708).
Debug-profile `cargo test` passes (2430/0), which is why CI never sees it. Found while independently verifying PR #5763 at `37e056ed037f77b76e614c4b342bc8c6399e079b`; pre-existing — storage_tests.rs is untouched by that PR (last touched by d40a33290).
## Repro
```
cd desktop/src-tauri && cargo test --release
# error[E0425]: cannot find function `copy_agent_keys_between_stores` in module `super`
```
## Fix shape
Gate the migration tests (or the whole block of them) with `#[cfg(debug_assertions)]` to match the items under test.
Contributor guide
Research direction
Start in desktop/src-tauri/src/managed_agents/storage_tests.rs and compare its migration tests with the #[cfg(debug_assertions)] items in storage.rs at lines 494 and 515. Run cargo test --release from desktop/src-tauri to reproduce the E0425 errors, then verify the release test command compiles and passes after the tests are consistently gated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- desktop-dev, testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100