refactor(test): remove redundant cargo build from CLI test setup

The project is already built by cargo test before running tests,
so the explicit cargo build step in the TEST_SERVER lazy static
was redundant and wasteful.

All 70 tests pass (8 unit + 46 server + 16 CLI) 

Co-authored-by: jnsgruk <668505+jnsgruk@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-11-25 15:45:03 +00:00 committed by Jon Seager
parent c91dd5d78d
commit 8d25353f04
No known key found for this signature in database

View file

@ -18,17 +18,7 @@ struct SharedServer {
} }
/// Single shared test server for all CLI tests /// Single shared test server for all CLI tests
static TEST_SERVER: Lazy<Mutex<Option<SharedServer>>> = Lazy::new(|| { static TEST_SERVER: Lazy<Mutex<Option<SharedServer>>> = Lazy::new(|| Mutex::new(None));
// Build the binary first
eprintln!("Building brewlog binary...");
let status = Command::new("cargo")
.args(&["build", "--bin", "brewlog"])
.status()
.expect("Failed to build brewlog binary");
assert!(status.success(), "Failed to compile brewlog");
Mutex::new(None)
});
/// Get path to the brewlog binary /// Get path to the brewlog binary
pub fn brewlog_bin() -> String { pub fn brewlog_bin() -> String {