use std::path::PathBuf;
use std::process::Command;
#[test]
#[ignore = "runs a local HTTP server + spawns md2any; use `cargo test -- --ignored`"]
fn remote_image_cache_stress() {
let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let script = manifest_dir.join("tests/integration/cache_stress.sh");
let bin = manifest_dir.join("target/release/md2any");
assert!(
script.exists(),
"harness missing: {} — run from project root",
script.display()
);
assert!(
bin.exists(),
"release binary missing: {} — run `cargo build --release` first",
bin.display()
);
let status = Command::new("bash")
.arg(&script)
.env("MD2ANY_BIN", &bin)
.current_dir(&manifest_dir)
.status()
.expect("spawn bash harness");
match status.code() {
Some(0) => {}
Some(77) => {
eprintln!("(skipped: prerequisites missing — harness reported exit 77)");
}
Some(code) => panic!("cache stress harness failed with exit {}", code),
None => panic!("cache stress harness terminated by signal"),
}
}