Skip to content

Commit 0836228

Browse files
committed
fix(opi-coding-agent): use debug binary for shell completion tests when release not available
1 parent 66e6d28 commit 0836228

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

crates/opi-coding-agent/tests/shell_completions.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,18 @@ use std::process::Command;
99
fn opi_bin() -> String {
1010
let manifest = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
1111
let workspace_root = manifest.parent().unwrap().parent().unwrap();
12-
let mut path = workspace_root.join("target/release/opi");
13-
if cfg!(windows) {
14-
path.set_extension("exe");
15-
}
12+
13+
// Prefer release binary, fall back to debug when running tests locally or in CI
14+
let exe_name = if cfg!(windows) { "opi.exe" } else { "opi" };
15+
let release = workspace_root.join("target/release").join(exe_name);
16+
let debug = workspace_root.join("target/debug").join(exe_name);
17+
18+
let path = if release.exists() {
19+
release
20+
} else {
21+
debug
22+
};
23+
1624
path.to_string_lossy().into_owned()
1725
}
1826

0 commit comments

Comments
 (0)