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)
This commit is contained in:
DanConwayDev
2026-01-11 16:05:06 +00:00
parent 59f429cb18
commit 149a6af5eb
2 changed files with 9 additions and 22 deletions
+5 -11
View File
@@ -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
+4 -11
View File
@@ -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