From 6022db4d9d9df3bad37d5c41daa0a1db8bf6e660 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Sun, 9 Feb 2020 23:49:22 +0100 Subject: [PATCH 1/3] tests.nixos-functions: port test to python --- pkgs/test/nixos-functions/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/test/nixos-functions/default.nix b/pkgs/test/nixos-functions/default.nix index 6dee0a27a79a1..6a4f3164f9296 100644 --- a/pkgs/test/nixos-functions/default.nix +++ b/pkgs/test/nixos-functions/default.nix @@ -33,7 +33,7 @@ in lib.optionalAttrs stdenv.hostPlatform.isLinux ( environment.systemPackages = [ pkgs.hello ]; }; testScript = '' - $machine->succeed("hello"); + machine.succeed("hello") ''; }); From d3efeb79b7059cf38d1baae03f2104b7a28dda36 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Sun, 9 Feb 2020 23:49:42 +0100 Subject: [PATCH 2/3] nixosTest: update to make-test-python.nix This still referred to the legacy make-test.nix (Perl) --- pkgs/top-level/all-packages.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0c9b909a9d067..e16165bb6981d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -25033,7 +25033,7 @@ in /* * Run a NixOS VM network test using this evaluation of Nixpkgs. * - * It is mostly equivalent to `import ./make-test.nix` from the + * It is mostly equivalent to `import ./make-test-python.nix` from the * NixOS manual[1], except that your `pkgs` will be used instead of * letting NixOS invoke Nixpkgs again. If a test machine needs to * set NixOS options under `nixpkgs`, it must set only the @@ -25059,11 +25059,11 @@ in */ nixosTest = let - /* The nixos/lib/testing.nix module, preapplied with arguments that + /* The nixos/lib/testing-python.nix module, preapplied with arguments that * make sense for this evaluation of Nixpkgs. */ nixosTesting = - (import ../../nixos/lib/testing.nix { + (import ../../nixos/lib/testing-python.nix { inherit (pkgs.stdenv.hostPlatform) system; inherit pkgs; extraConfigurations = [( From 0945178b3c6fd9e33002dd6e3c6f77dfca49565a Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Thu, 6 Feb 2020 12:19:47 +0100 Subject: [PATCH 3/3] nixos/testing: add deprecation notice for Perl VM tests Most VM tests have been migrated to use the python test driver (introduced in #71684), the migration is tracked in #72828 (which also thankfully uncovered and fixed many currently broken tests) While increasing the acceptance and adoption of NixOS integration tests by using a more popular language, there was also nobody willing to do larger refactors in the currently very convoluted test infrastructure. We plan to remove the perl infrastructure between the 20.03 and 20.09 release, to be able to do these refactorings. Some people might be using Perl tests in their internal CI, so print a warning for 20.03, and give users time to move to the python testing infrastructure. --- nixos/lib/testing.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixos/lib/testing.nix b/nixos/lib/testing.nix index ae8ecd6270ce3..c82abd1f99003 100644 --- a/nixos/lib/testing.nix +++ b/nixos/lib/testing.nix @@ -19,7 +19,11 @@ in rec { inherit pkgs; - testDriver = stdenv.mkDerivation { + testDriver = lib.warn '' + Perl VM tests are deprecated and will be removed for 20.09. + Please update your tests to use the python test driver. + See https://github.com/NixOS/nixpkgs/pull/71684 for details. + '' stdenv.mkDerivation { name = "nixos-test-driver"; buildInputs = [ makeWrapper perl ];