mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-05 15:08:24 +00:00
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:
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user