about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPjotr Prins <pjotr.public01@thebird.nl>2026-11-27 11:55:11 +0000
committerPjotr Prins <pjotr.public01@thebird.nl>2026-11-27 11:55:11 +0000
commit2543b022d3f3f2087fdea02b351811bc9096b2c2 (patch)
treea8f4324869004194104dc3f708edcd4d260e960c
parent99555d15161df884464fce2305640f6110b845e0 (diff)
downloadgenenetwork4-2543b022d3f3f2087fdea02b351811bc9096b2c2.tar.gz
tests: skip the crate route test when there is no index
It needs a real xapian index and said so, but failed rather than skipped
when none was configured, which breaks any hermetic run -- the store build
among them, where XAPIAN_DB_PATH has no index to point at. Skip loudly, the
convention tests/search_native.rs already follows.
-rw-r--r--tests/search_crate_http.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/search_crate_http.rs b/tests/search_crate_http.rs
index 7248dca..e3d44e5 100644
--- a/tests/search_crate_http.rs
+++ b/tests/search_crate_http.rs
@@ -27,6 +27,15 @@ async fn the_route_serves_the_extracted_engine() {
         );
     }
 
+    // A store build (guix, no network, no dev index) must stay green: skip
+    // loudly instead of failing, the convention tests/search_native.rs
+    // already follows for its per-page invariant.
+    let index = std::env::var("XAPIAN_DB_PATH").unwrap_or_default();
+    if !std::fs::metadata(&index).map(|m| m.is_dir()).unwrap_or(false) {
+        eprintln!("skipping the crate-engine route test: no XAPIAN_DB_PATH index at {index:?}");
+        return;
+    }
+
     // gn-auth's JWKS stub: token verification must not need a live gn-auth.
     let auth_stub = {
         let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap();