Skip to content

Commit

Permalink
treewide: nixosTest -> runNixOSTest, or remove
Browse files Browse the repository at this point in the history
  • Loading branch information
roberth committed Apr 23, 2024
1 parent dd6474c commit c44c917
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion nixos/lib/testing/legacy.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
);
};
Expand Down
2 changes: 1 addition & 1 deletion nixos/lib/testing/nixos-test-base.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
8 changes: 7 additions & 1 deletion nixos/tests/nixops/default.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
These tests may be run with:
nix-build -A nixosTests.nixops
*/
{ pkgs, ... }:
let
inherit (pkgs) lib;
Expand All @@ -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, ... }: {
Expand Down
10 changes: 7 additions & 3 deletions nixos/tests/nixos-test-driver/lib-extend.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
These tests may be run with:
nix-build -A nixosTests.nixos-test-driver.lib-extend
*/
{ pkgs, ... }:

let
Expand All @@ -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;
}
2 changes: 1 addition & 1 deletion nixos/tests/spark/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ let
};
});
in
testers.nixosTest {
testers.runNixOSTest {
name = "nixpkgs-trivial-builders";
nodes.machine = { ... }: {
virtualisation.writableStore = true;
Expand Down
4 changes: 0 additions & 4 deletions pkgs/test/nixos-functions/default.nix
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit c44c917

Please sign in to comment.