From 149a6af5ebe7d92f8063734104e444f48b33b012 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Sun, 11 Jan 2026 16:05:06 +0000 Subject: fix: only run unit tests during Nix build, skip integration tests Changed from selectively skipping test modules to running only --lib tests (unit tests). This is cleaner and more maintainable. Integration tests (tests/*.rs) require: - git binary in PATH - Ability to spawn subprocesses - Network access for some tests - TestRelay fixture (spawns ngit-grasp) These requirements don't work in the Nix sandbox, so we run only unit tests (--lib) during package build. Full integration test suite runs in environments where git is available: - Local dev (nix develop includes git) - CI/CD (git installed) - Manual testing (cargo test runs all tests) --- flake.nix | 16 +++++----------- nix/module.nix | 15 ++++----------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/flake.nix b/flake.nix index cf4f328..446455e 100644 --- a/flake.nix +++ b/flake.nix @@ -50,17 +50,11 @@ buildInputs = with pkgs; [ openssl ]; - # Skip tests that require git in PATH (sandboxing issue) - # These tests run fine in dev environment and CI - checkFlags = [ - # Unit tests that spawn git subprocesses - "--skip=git::subprocess::tests::" - "--skip=git::tests::" - "--skip=purgatory::helpers::tests::" - # Integration tests that create git repos - "--skip=common::git_server::" - "--skip=common::purgatory_helpers::" - ]; + # Skip all integration tests during Nix build (require git in PATH) + # Integration tests run in dev environment and CI where git is available + doCheck = true; + cargoTestFlags = + [ "--lib" ]; # Only run unit tests, skip integration tests }; })) // { # NixOS module for deployment diff --git a/nix/module.nix b/nix/module.nix index 23b1561..1cbeb27 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -18,17 +18,10 @@ let nativeBuildInputs = with pkgs; [ pkg-config ]; buildInputs = with pkgs; [ openssl ]; - # Skip tests that require git in PATH (sandboxing issue) - # These tests run fine in dev environment and CI - checkFlags = [ - # Unit tests that spawn git subprocesses - "--skip=git::subprocess::tests::" - "--skip=git::tests::" - "--skip=purgatory::helpers::tests::" - # Integration tests that create git repos - "--skip=common::git_server::" - "--skip=common::purgatory_helpers::" - ]; + # Skip all integration tests during Nix build (require git in PATH) + # Integration tests run in dev environment and CI where git is available + doCheck = true; + cargoTestFlags = [ "--lib" ]; # Only run unit tests, skip integration tests }; # Per-instance options -- cgit v1.2.3