diff --git a/AGENTS.md b/AGENTS.md index 0fa47bc..7525d14 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -61,6 +61,7 @@ Coreutils, diffutils, procps, and brush use relative symlinks to one binary each `nix flake check` checks the packaged host, its bundle, and the whole host/VFS test suite. Sandbox-incompatible tests print an explicit skip reason instead of a flake-level filter. +The check sets `SAUSAGE_NIX_CHECK=1` for tests that need network access or unvendored fixture dependencies. ## Tests diff --git a/flake.nix b/flake.nix index 0763ff6..bb668ed 100644 --- a/flake.nix +++ b/flake.nix @@ -167,6 +167,7 @@ doCheck = true; nativeBuildInputs = hostArgs.nativeBuildInputs ++ builderTools ++ [ pkgs.git pkgs.nodejs ]; SAUSAGE_TEST_NO_BUILDER_SANDBOX = "1"; + SAUSAGE_NIX_CHECK = "1"; SAUSAGE_USERLAND = bundle; preCheck = '' export SAUSAGE_CACHE="$TMPDIR/sausage-cache" diff --git a/host/tests/it/builder.rs b/host/tests/it/builder.rs index 6668657..ad6d29f 100644 --- a/host/tests/it/builder.rs +++ b/host/tests/it/builder.rs @@ -170,6 +170,12 @@ fn cache_hits(base: &Path) -> anyhow::Result { } #[tokio::test(flavor = "multi_thread")] async fn cargo_build_test_and_source_changes() -> anyhow::Result<()> { + if std::env::var("SAUSAGE_NIX_CHECK").as_deref() == Ok("1") { + println!( + "SKIP builder::cargo_build_test_and_source_changes: the isolated builder fixture requires crates.io access" + ); + return Ok(()); + } let binaries = programs(); let temp = tempfile::tempdir()?; let world = World::open(temp.path())?; diff --git a/host/tests/it/harness_shutdown.rs b/host/tests/it/harness_shutdown.rs index 769126e..de93007 100644 --- a/host/tests/it/harness_shutdown.rs +++ b/host/tests/it/harness_shutdown.rs @@ -60,7 +60,7 @@ fn sigterm_cancels_tool_and_resumes() -> anyhow::Result<()> { "-p", "sausage-coreutils", "--bin", - "sleep", + "coreutils", "--manifest-path", ]) .arg(source.join("Cargo.toml")) @@ -74,7 +74,7 @@ fn sigterm_cancels_tool_and_resumes() -> anyhow::Result<()> { World::open(dir.path())?; std::fs::create_dir_all(dir.path().join("world/bin"))?; std::fs::copy( - target.join("wasm32-wasip2/release/sleep.wasm"), + target.join("wasm32-wasip2/release/coreutils.wasm"), dir.path().join("world/bin/sleep.wasm"), )?; let spawn = || { diff --git a/host/tests/it/hook.rs b/host/tests/it/hook.rs index d3c3e73..4687a92 100644 --- a/host/tests/it/hook.rs +++ b/host/tests/it/hook.rs @@ -52,6 +52,12 @@ async fn run(runtime: &Arc, url: String, chain: Vec) -> String } #[tokio::test] async fn identity_injection_denial_and_ambiguity() { + if std::env::var("SAUSAGE_NIX_CHECK").as_deref() == Ok("1") { + println!( + "SKIP hook::identity_injection_denial_and_ambiguity: the wstd fixture dependency is not vendored" + ); + return; + } let guest = hook_guest::component(); let temp = tempfile::tempdir().unwrap(); let world = World::open(temp.path()).unwrap(); @@ -325,6 +331,12 @@ async fn upstream( #[tokio::test] async fn streamed_upload_redirect_and_http_admin_denial() { + if std::env::var("SAUSAGE_NIX_CHECK").as_deref() == Ok("1") { + println!( + "SKIP hook::streamed_upload_redirect_and_http_admin_denial: the wstd fixture dependency is not vendored" + ); + return; + } let guest = hook_guest::component(); let temp = tempfile::tempdir().unwrap(); let world = World::open(temp.path()).unwrap(); diff --git a/host/tests/it/hook_api.rs b/host/tests/it/hook_api.rs index 5b7da6e..0ce7f78 100644 --- a/host/tests/it/hook_api.rs +++ b/host/tests/it/hook_api.rs @@ -16,6 +16,12 @@ use super::hook_guest; #[tokio::test] async fn one_api_for_pages_and_guest_requests() -> anyhow::Result<()> { + if std::env::var("SAUSAGE_NIX_CHECK").as_deref() == Ok("1") { + println!( + "SKIP hook_api::one_api_for_pages_and_guest_requests: the wstd fixture dependency is not vendored" + ); + return Ok(()); + } use webauthn_authenticator_rs::{WebauthnAuthenticator, softpasskey::SoftPasskey}; let dir = tempfile::tempdir()?; let world = World::open(dir.path())?;