diff options
author | Robert Hensing <roberth@users.noreply.github.com> | 2024-06-20 15:50:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-20 15:50:22 +0200 |
commit | cb5a0285b06f959149f25b4adad81c4f01c34ead (patch) | |
tree | 9abc6b8c4dd354bc82fbaa8c5739cb49e59d5b75 /pkgs | |
parent | 1655b257db11584efb063692b1603ca0ae0c1919 (diff) | |
parent | abf7172bfafdd6f67d5df62d08d9cd2d4d107975 (diff) |
Merge pull request #292759 from ShamrockLee/test-references-darwin
tests.references: use `runNixOSTest` instead of `nixosTest`
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/build-support/trivial-builders/test/references/default.nix | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/pkgs/build-support/trivial-builders/test/references/default.nix b/pkgs/build-support/trivial-builders/test/references/default.nix index 928cc1d9461f0..85df57ea210c2 100644 --- a/pkgs/build-support/trivial-builders/test/references/default.nix +++ b/pkgs/build-support/trivial-builders/test/references/default.nix @@ -93,21 +93,27 @@ let }; }); in -testers.nixosTest { - name = "nixpkgs-trivial-builders"; - nodes.machine = { ... }: { +testers.runNixOSTest ({ config, lib, ... }: +let + # Use the testScriptBin from guest pkgs. + # The attribute path to access the guest version of testScriptBin is + # tests.trivial-builders.references.config.node.pkgs.tests.trivial-builders.references.testScriptBin + # which is why passthru.guestTestScriptBin is provided. + guestTestScriptBin = config.node.pkgs.tests.trivial-builders.references.testScriptBin; +in +{ + name = "nixpkgs-trivial-builders-references"; + nodes.machine = { config, lib, pkgs, ... }: { virtualisation.writableStore = true; # Test runs without network, so we don't substitute and prepare our deps nix.settings.substituters = lib.mkForce [ ]; - environment.etc."pre-built-paths".source = writeText "pre-built-paths" ( - builtins.toJSON [ testScriptBin ] - ); + system.extraDependencies = [ guestTestScriptBin ]; }; testScript = '' machine.succeed(""" - ${lib.getExe testScriptBin} 2>/dev/console + ${lib.getExe guestTestScriptBin} 2>/dev/console """) ''; passthru = { @@ -118,6 +124,7 @@ testers.nixosTest { samples testScriptBin ; + inherit guestTestScriptBin; }; meta = { maintainers = with lib.maintainers; [ @@ -125,4 +132,4 @@ testers.nixosTest { ShamrockLee ]; }; -} +}) |