test: add check only on Linux

This commit is contained in:
Sridhar Ratnakumar 2023-06-14 13:03:52 -04:00
parent bbc4d756d5
commit 9f5b1e6f22
2 changed files with 6 additions and 5 deletions

View File

@ -51,6 +51,9 @@ in
The testScript will have access to `process_compose.wait` function that
can be used to get the running process information, after waiting for
the specified readiness status.
The check is added only on Linux, inasmuch as nixosTest is not available
on Darwin.
'';
default = null;
example = ''
@ -63,7 +66,7 @@ in
outputs.check = mkOption {
type = types.nullOr types.package;
default =
if config.testScript == null then null else
if (config.testScript == null || !pkgs.stdenv.isLinux) then null else
pkgs.nixosTest {
testScript = testLibrary + "\n" + config.testScript;
name = "process-compose-${name}-test";

View File

@ -6,7 +6,5 @@ cd ./example
# First, build the example.
nix build -L --no-link --print-out-paths --override-input process-compose-flake ..
# When on NixOS, run the VM tests to test runtime behaviour
if command -v nixos-rebuild &> /dev/null; then
nix flake check -L --override-input process-compose-flake ..
fi
# On NixOS, run the VM tests to test runtime behaviour
nix flake check -L --override-input process-compose-flake ..