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 # - Alternatively, blocked on a NixOps 2 release
# https://github.com/NixOS/nixops/issues/1242 # https://github.com/NixOS/nixops/issues/1242
# stable = testsLegacyNetwork { nixopsPkg = pkgs.nixops; }; # stable = testsLegacyNetwork { nixopsPkg = pkgs.nixops; };
unstable = testsForPackage { nixopsPkg = pkgs.nixops_unstable; }; unstable = testsForPackage { nixopsPkg = pkgs.nixops_unstable_minimal; };
# inherit testsForPackage; # inherit testsForPackage;
}; };

View File

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

View File

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