fix(test): zot_rpc_smoke — remove #[ignore], fall back to PATH #265
1 changed files with 11 additions and 3 deletions
|
|
@ -24,10 +24,18 @@ use tokio::io::{AsyncBufReadExt, BufReader};
|
|||
use tokio::time::timeout;
|
||||
|
||||
#[tokio::test]
|
||||
#[ignore = "needs a built zot binary; set ZOT_BIN"]
|
||||
async fn zot_rpc_driver_delivers_prompt_and_streams_events() {
|
||||
let Ok(zot_bin) = std::env::var("ZOT_BIN") else {
|
||||
eprintln!("ZOT_BIN not set; skipping zot rpc driver test");
|
||||
let zot_bin = std::env::var("ZOT_BIN").ok().or_else(|| {
|
||||
// Fallback: search PATH for a zot binary.
|
||||
std::env::var("PATH").ok().and_then(|path| {
|
||||
path.split(':')
|
||||
.map(|d| std::path::Path::new(d).join("zot"))
|
||||
.find(|p| p.exists())
|
||||
.map(|p| p.to_string_lossy().to_string())
|
||||
})
|
||||
});
|
||||
let Some(zot_bin) = zot_bin else {
|
||||
eprintln!("ZOT_BIN not set and zot not found in PATH; skipping");
|
||||
return;
|
||||
};
|
||||
assert!(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue