Several tests can't run in hermetic build sandboxes (FHS paths, cleared environment, missing timeouts)
Describe the bug Building Buzz from source with its test suites (nixpkgs, and other distributions that build in a sandbox) needs about 20 tests skipped. They fall into a few groups:
- FHS interpreters. 13 tests in
desktop/src-taurirun/bin/bashor/usr/bin/true, write#!/usr/bin/env nodescripts, or runenv/truewithPATHcleared, and the process-group tests start/bin/sleep; 5 incrates/buzz-acprun fake agents from#!/bin/bashand#!/usr/bin/envscripts. The Nix build sandbox has only/bin/sh, and NixOS itself adds only/usr/bin/env. I know the absolute paths are deliberate in places (managed_agents/runtime/tests.rs: parallel tests swapPATH, so a lookup during the swap flakes). - Cleared environment, then TLS.
buzz-agent'scli_signin_aliases_reuse_legacy_cache_without_runtime_configuration(tests/databricks_cli_auth.rs) andbuzz-acp'stask_native_git_and_startup_shutdown_cleanup(tests/git_bootstrap.rs) start the binary withenv_clear(). That dropsSSL_CERT_FILE, so building the HTTP client fails where there is no system CA store. - Hangs instead of failures.
metadata_command_cancellation_drops_an_in_flight_responseandmetadata_pipeline_remains_pending_beyond_former_aggregate_deadline(desktop/src-tauri/src/commands/link_preview_tests.rs:72,:119) awaitrequest_started_rxwithout a timeout. When the spawned fetch task panics (here:reqwest::Client::new()couldn't load CA certificates), the test never finishes; my build ran for hours. - A flaky test.
provider_deploy_refuses_mismatch_before_sending_agent_secret(desktop/src-tauri/src/managed_agents/backend_tests.rs:276) runs a provider script it has just written while a parallel test may still hold the file open ("Text file busy"). - macOS sandbox.
buzz-agent's Databricks OAuth tests (9) bind the mock server to127.0.0.1but point the client athttps://localhost:<port>(src/databricks_test_support.rs); the macOS sandbox can't resolvelocalhost.buzz-acp'skeepalive_resets_idle_past_deadline(src/acp.rs:3639) andidle_resets_on_stdout_activityassert timing and fail on slower runners ("elapsed only 112ms").
Steps to reproduce
Run the suites without /bin/bash, /usr/bin/env and a system CA store, e.g. in the nixpkgs build (nix-build -A buzz-acp with the skips removed), or in a minimal container with only SSL_CERT_FILE pointing at a CA bundle.
Expected behavior
The tests resolve each interpreter once, before any test swaps PATH (for example into a OnceLock at first use), or skip when it is missing; pass SSL_CERT_FILE/SSL_CERT_DIR through after env_clear(), time out instead of hanging, and connect to the address they bound (or use ClientBuilder::resolve("localhost", addr), which keeps the certificate name).
Version and platform
- Buzz version: 0.5.28 (code as of
main347ce88d5) - OS: NixOS (x86_64-linux, aarch64-linux) and macOS (aarch64-darwin), all in the Nix build sandbox
Logs / additional context The nixpkgs packages list every skipped test with a comment (NixOS/nixpkgs#570552, #571723). I'm happy to send PRs group by group if that's welcome.
Closing: I'm focusing on Buzz 1.0 (block/buzz-app), which doesn't use this code.