nixops_unstable: Fix tests attribute

The .overrideAttrs part is ok now, but a "passthru' workaround is
necessary now. See https://github.com/NixOS/nixpkgs/pull/247520
This commit is contained in:
Robert Hensing 2023-08-09 15:47:07 +02:00
parent bb02d10364
commit 4b51c5360f
2 changed files with 12 additions and 12 deletions

View file

@ -14,11 +14,12 @@ let
# inherit testsForPackage; # inherit testsForPackage;
}; };
testsForPackage = lib.makeOverridable (args: lib.recurseIntoAttrs { testsForPackage = args: lib.recurseIntoAttrs {
legacyNetwork = testLegacyNetwork args; legacyNetwork = testLegacyNetwork args;
}); passthru.override = args': testsForPackage (args // args');
};
testLegacyNetwork = { nixopsPkg }: pkgs.nixosTest ({ testLegacyNetwork = { nixopsPkg, ... }: pkgs.nixosTest ({
name = "nixops-legacy-network"; name = "nixops-legacy-network";
nodes = { nodes = {
deployer = { config, lib, nodes, pkgs, ... }: { deployer = { config, lib, nodes, pkgs, ... }: {
@ -52,7 +53,7 @@ let
chmod 0400 ~/.ssh/id_ed25519 chmod 0400 ~/.ssh/id_ed25519
''; '';
serverNetworkJSON = pkgs.writeText "server-network.json" serverNetworkJSON = pkgs.writeText "server-network.json"
(builtins.toJSON nodes.server.config.system.build.networkConfig); (builtins.toJSON nodes.server.system.build.networkConfig);
in in
'' ''
import shlex import shlex

View file

@ -92,7 +92,7 @@ let
} }
).python; ).python;
pkg = interpreter.pkgs.nixops.withPlugins(ps: [ pkg = (interpreter.pkgs.nixops.withPlugins(ps: [
ps.nixops-aws ps.nixops-aws
ps.nixops-digitalocean ps.nixops-digitalocean
ps.nixops-encrypted-links ps.nixops-encrypted-links
@ -102,11 +102,10 @@ let
ps.nixopsvbox ps.nixopsvbox
ps.nixops-virtd ps.nixops-virtd
ps.nixops-hetznercloud ps.nixops-hetznercloud
]) // rec { ])).overrideAttrs (finalAttrs: prevAttrs: {
# Workaround for https://github.com/NixOS/nixpkgs/issues/119407 passthru = prevAttrs.passthru or {} // {
# TODO after #1199407: Use .overrideAttrs(pkg: old: { passthru.tests = .....; }) tests = prevAttrs.passthru.tests or {} //
tests = nixosTests.nixops.unstable.override { nixopsPkg = pkg; }; nixosTests.nixops.unstable.passthru.override { nixopsPkg = pkg; };
# Not strictly necessary, but probably expected somewhere; part of the workaround: };
passthru.tests = tests; });
};
in pkg in pkg