From c44c917f2ae51e4b5e81302bc7f7f732ab8f54fe Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 23 Apr 2024 13:00:42 +0200 Subject: [PATCH] treewide: nixosTest -> runNixOSTest, or remove --- nixos/lib/testing/legacy.nix | 2 +- nixos/lib/testing/nixos-test-base.nix | 2 +- nixos/tests/nixops/default.nix | 8 +++++++- nixos/tests/nixos-test-driver/lib-extend.nix | 10 +++++++--- nixos/tests/spark/default.nix | 2 +- .../trivial-builders/test/references/default.nix | 2 +- pkgs/test/nixos-functions/default.nix | 4 ---- 7 files changed, 18 insertions(+), 12 deletions(-) diff --git a/nixos/lib/testing/legacy.nix b/nixos/lib/testing/legacy.nix index b310575566015..b209781e22d4d 100644 --- a/nixos/lib/testing/legacy.nix +++ b/nixos/lib/testing/legacy.nix @@ -19,7 +19,7 @@ in config = { nodes = mkIf options.machine.isDefined ( lib.warn - "In test `${config.name}': The `machine' attribute in NixOS tests (pkgs.nixosTest / make-test-python.nix / testing-python.nix / makeTest) is deprecated. Please set the equivalent `nodes.machine'." + "In test `${config.name}': The `machine' attribute in NixOS tests is deprecated. Please set the equivalent `nodes.machine'." { inherit (config) machine; } ); }; diff --git a/nixos/lib/testing/nixos-test-base.nix b/nixos/lib/testing/nixos-test-base.nix index d76a25361f8ca..59396197a75c7 100644 --- a/nixos/lib/testing/nixos-test-base.nix +++ b/nixos/lib/testing/nixos-test-base.nix @@ -14,7 +14,7 @@ in key = "no-revision"; # Make the revision metadata constant, in order to avoid needless retesting. # The human version (e.g. 21.05-pre) is left as is, because it is useful - # for external modules that test with e.g. testers.nixosTest and rely on that + # for external modules that test with e.g. testers.runNixOSTest and rely on that # version number. config.system.nixos = { revision = mkForce "constant-nixos-revision"; diff --git a/nixos/tests/nixops/default.nix b/nixos/tests/nixops/default.nix index 6468b8c382249..1caf249c036fd 100644 --- a/nixos/tests/nixops/default.nix +++ b/nixos/tests/nixops/default.nix @@ -1,3 +1,9 @@ +/* + These tests may be run with: + + nix-build -A nixosTests.nixops + +*/ { pkgs, ... }: let inherit (pkgs) lib; @@ -19,7 +25,7 @@ let passthru.override = args': testsForPackage (args // args'); }; - testLegacyNetwork = { nixopsPkg, ... }: pkgs.testers.nixosTest ({ + testLegacyNetwork = { nixopsPkg, ... }: pkgs.testers.runNixOSTest ({ name = "nixops-legacy-network"; nodes = { deployer = { config, lib, nodes, pkgs, ... }: { diff --git a/nixos/tests/nixos-test-driver/lib-extend.nix b/nixos/tests/nixos-test-driver/lib-extend.nix index 4fb7cf494aed6..5b97ed32fcd26 100644 --- a/nixos/tests/nixos-test-driver/lib-extend.nix +++ b/nixos/tests/nixos-test-driver/lib-extend.nix @@ -1,3 +1,9 @@ +/* + These tests may be run with: + + nix-build -A nixosTests.nixos-test-driver.lib-extend + + */ { pkgs, ... }: let @@ -22,10 +28,8 @@ let testScript = ""; }; - inherit (patchedPkgs.testers) nixosTest runNixOSTest; - evaluationNixosTest = nixosTest testBody; + inherit (patchedPkgs.testers) runNixOSTest; evaluationRunNixOSTest = runNixOSTest testBody; in { - nixosTest = evaluationNixosTest.driver.nodes.machine.system.build.toplevel; runNixOSTest = evaluationRunNixOSTest.driver.nodes.machine.system.build.toplevel; } diff --git a/nixos/tests/spark/default.nix b/nixos/tests/spark/default.nix index 034e9711bed52..439206c0391bf 100644 --- a/nixos/tests/spark/default.nix +++ b/nixos/tests/spark/default.nix @@ -10,7 +10,7 @@ let sparkCluster = testSparkCluster args; passthru.override = args': testsForPackage (args // args'); }; - testSparkCluster = { sparkPackage, ... }: pkgs.testers.nixosTest ({ + testSparkCluster = { sparkPackage, ... }: pkgs.testers.runNixOSTest ({ name = "spark"; nodes = { diff --git a/pkgs/build-support/trivial-builders/test/references/default.nix b/pkgs/build-support/trivial-builders/test/references/default.nix index 928cc1d9461f0..5e80ff9ea6e40 100644 --- a/pkgs/build-support/trivial-builders/test/references/default.nix +++ b/pkgs/build-support/trivial-builders/test/references/default.nix @@ -93,7 +93,7 @@ let }; }); in -testers.nixosTest { +testers.runNixOSTest { name = "nixpkgs-trivial-builders"; nodes.machine = { ... }: { virtualisation.writableStore = true; diff --git a/pkgs/test/nixos-functions/default.nix b/pkgs/test/nixos-functions/default.nix index bdd5e3c6d8b42..40da5055f97e5 100644 --- a/pkgs/test/nixos-functions/default.nix +++ b/pkgs/test/nixos-functions/default.nix @@ -1,9 +1,5 @@ /* -This file is a test that makes sure that the `pkgs.nixos` and -`pkgs.testers.nixosTest` functions work. It's far from a perfect test suite, -but better than not checking them at all on hydra. - To run this test: nixpkgs$ nix-build -A tests.nixos-functions