fix(tests): use CARGO_BIN_EXE for binary path in CLI tests

The CLI tests hardcoded target/debug/brewlog, but nix builds in
release mode. Use Cargo's CARGO_BIN_EXE_brewlog env var which
automatically points to the correct binary location.

This enables running tests during nix build (removes doCheck = false).
This commit is contained in:
Jon Seager 2026-02-02 17:37:04 +00:00
parent 6cd621e10a
commit c7ea7420ae
No known key found for this signature in database

View file

@ -22,8 +22,8 @@ static TEST_SERVER: Lazy<Mutex<Option<SharedServer>>> = Lazy::new(|| Mutex::new(
/// Get path to the brewlog binary
pub fn brewlog_bin() -> String {
let manifest_dir = env!("CARGO_MANIFEST_DIR");
format!("{}/target/debug/brewlog", manifest_dir)
// Cargo sets this for integration tests - works for both debug and release
env!("CARGO_BIN_EXE_brewlog").to_string()
}
/// Get or start the shared test server - handles mutex poisoning gracefully