desktop/src-tauri: cargo test --release fails to compile (dev-only migration symbols referenced from unconditional tests)

Open Beginner friendly
#6,150 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
testing

Research direction

Start by running cargo test --release in desktop/src-tauri to reproduce the missing-symbol errors. Inspect managed_agents/storage.rs around lines 494 and 514-515, then compare the dependent tests in managed_agents/storage_tests.rs around lines 541, 582, and 608. Done means the crate's release-profile test suite compiles and runs without the unresolved symbols.

Written by the indexing model from the issue text.

Description

Summary

cargo test --release does not compile in desktop/src-tauri. The test build fails with E0425: cannot find function copy_agent_keys_between_stores in module super (and the same for DEV_MIGRATION_MARKER).

Debug builds are unaffected, so nothing in CI catches it.

Cause

managed_agents/storage.rs gates both items on debug builds:

// storage.rs:494
const DEV_MIGRATION_MARKER: &str = "_dev_migration_v1";
// storage.rs:514-515
#[cfg(debug_assertions)]
fn copy_agent_keys_between_stores(...)

managed_agents/storage_tests.rs references them unconditionally (super::DEV_MIGRATION_MARKER at lines 541, 582, 608, and the function in the tests around them). Under --release, debug_assertions is off, the definitions vanish, and the test module no longer resolves them.

Scope

Present on main (076081bfc), not introduced by any in-flight branch — I hit it while trying to take a release-profile measurement on #6024 and ran it as a control on an unmodified tree before blaming my own change.

The practical consequence is that no one can run this crate's test suite under --release, which is exactly the profile you want for any performance measurement. I worked around it with --config profile.test.opt-level=2, which keeps debug_assertions on — usable, but it means optimized measurements of this crate are systematically conservative and nobody can easily check a real release build.

Fix

Gate the dependent tests to match their subject — #[cfg(all(test, debug_assertions))] on the tests that use the dev-only migration path — or drop the #[cfg(debug_assertions)] from the function and marker if they are meant to be reachable in release.

Dominant language
Rust
Stars
33.7k
Forks
4.4k
Avg merge
1d 21h
Merged PRs (30d)
239

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from block/buzz

All issues in block/buzz

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.