From c7ea7420aefa4a26161ee2d523242892d7478511 Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Mon, 2 Feb 2026 17:37:04 +0000 Subject: [PATCH] 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). --- tests/cli/helpers.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cli/helpers.rs b/tests/cli/helpers.rs index c9e315e..e4e254c 100644 --- a/tests/cli/helpers.rs +++ b/tests/cli/helpers.rs @@ -22,8 +22,8 @@ static TEST_SERVER: Lazy>> = 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