Commit Graph

11 Commits

Author SHA1 Message Date
Gabriella Gonzalez
b8698cd8d6
macOS support for NixOS tests (#282401)
Closes #193336
Closes #261694
Related to #108984

The goal here was to get the following flake to build and run on
`aarch64-darwin`:

```nix
{ inputs.nixpkgs.url = <this branch>;

  outputs = { nixpkgs, ... }: {
    checks.aarch64-darwin.default =
      nixpkgs.legacyPackages.aarch64-darwin.nixosTest {
        name = "test";

        nodes.machine = { };

        testScript = "";
      };
  };
}
```

… and after this change it does.  There's no longer a need for the
user to set `nodes.*.nixpkgs.pkgs` or
`nodes.*.virtualisation.host.pkgs` as the correct values are inferred
from the host system.
2024-03-02 06:33:14 +01:00
sternenseemann
af60e68744 testers.hasPkgConfigModules: allow checking multiple pkg-config mods
This is very useful in conjunction with meta.pkgConfigModules, as the
new tester can use the list provided by this meta attribute as a default
value for moduleNames, making its usage in passthru.tests very
convenient.

For backwards compatibility, a shim under the old name is maintained
with a warning.
2023-08-08 19:16:48 +02:00
Robert Hensing
ac1134f321 testers.runNixOSTest: init
An up to date alternative to pkgs.nixosTest
2023-05-11 19:12:07 +02:00
Robert Hensing
b6bec17eb9 testers.hasPkgConfigModule: Extract and add tests, docs 2023-01-30 00:35:34 +01:00
Artturin
3f3ca2d90d tests.testers.testBuildFailure.helloDoesNotFail: fix confusing output
the output made me think that the test failed but did not fail

testBuildFailure-helloDoesNotFail> Checking /nix/store/x6403x1llpk00i59cmr96iy92mx1f7hb-hello-2.12.1/testBuildFailure.log
testBuildFailure-helloDoesNotFail> testBuildFailure: The builder did not fail, but a failure was expected!
2023-01-17 20:49:24 +02:00
Robert Hensing
dbdd8fad26 testers.testBuildFailure: Read last log line without final newline 2022-12-02 16:12:50 +00:00
Robert Hensing
e20a362908 testers.testEqualContents: init 2022-10-27 14:06:38 +02:00
Robert Hensing
44d0f37833 testers.testBuildFailure: init 2022-10-27 14:06:38 +02:00
Robert Hensing
c3bbe1d9c7 testers.nixosTest: Remove redundant system.stateVersion = lib.trivial.release;
Already present in nixos/modules/testing/test-instrumentation.nix,
which is imported by the test framework.
2022-05-09 14:33:49 +02:00
Robert Hensing
ebf0465d09 Merge remote-tracking branch 'upstream/master' into testers 2022-05-09 14:27:13 +02:00
Robert Hensing
93abb7bef7 tests.testers.nixosTest-example: move from tests.nixos-functions.nixosTest-test
And improve the test a bit, to assert correct wiring of `pkgs`.
2022-05-09 14:21:56 +02:00