nixops_unstable*: Make withPlugins.*.tests.nixos behave correctly

This commit is contained in:
Robert Hensing 2024-02-28 16:22:34 +01:00
parent 4a29e5442d
commit 663b3d4be7
3 changed files with 10 additions and 4 deletions

View File

@ -9,7 +9,7 @@ let
# - Alternatively, blocked on a NixOps 2 release
# https://github.com/NixOS/nixops/issues/1242
# stable = testsLegacyNetwork { nixopsPkg = pkgs.nixops; };
unstable = testsForPackage { nixopsPkg = pkgs.nixops_unstable; };
unstable = testsForPackage { nixopsPkg = pkgs.nixops_unstable_minimal; };
# inherit testsForPackage;
};

View File

@ -28,8 +28,8 @@ let
# selector is a function mapping pythonPackages to a list of plugins
# e.g. nixops_unstable.withPlugins (ps: with ps; [ nixops-aws ])
withPlugins = selector: let
selected = selector (plugins python.pkgs);
in python.pkgs.toPythonApplication (python.pkgs.nixops.overridePythonAttrs (old: {
selected = selector (plugins python.pkgs);
r = python.pkgs.toPythonApplication (python.pkgs.nixops.overridePythonAttrs (old: {
propagatedBuildInputs = old.propagatedBuildInputs ++ selected;
# Propagating dependencies leaks them through $PYTHONPATH which causes issues
@ -41,8 +41,14 @@ let
passthru = old.passthru // {
plugins = plugins python.pkgs;
inherit withPlugins python;
tests = old.passthru.tests // {
nixos = old.passthru.tests.nixos.passthru.override {
nixopsPkg = r;
};
};
};
}));
in r;
in {
nixops_unstable_minimal = withPlugins (ps: []);

View File

@ -50,7 +50,7 @@ buildPythonApplication rec {
pythonImportsCheck = [ "nixops" ];
passthru = {
tests.nixops = nixosTests.nixops.unstable;
tests.nixos = nixosTests.nixops.unstable;
updateScript = unstableGitUpdater {};
};