Merge pull request #34201 from dezgeg/release-refactor-3
nixos/release.nix: Introduce callSubTestsOnTheseSystems
This commit is contained in:
commit
e23b6a394b
@ -57,7 +57,7 @@ in rec {
|
|||||||
nixos.ova.x86_64-linux
|
nixos.ova.x86_64-linux
|
||||||
|
|
||||||
#(all nixos.tests.containers)
|
#(all nixos.tests.containers)
|
||||||
nixos.tests.chromium
|
nixos.tests.chromium.x86_64-linux
|
||||||
(all nixos.tests.firefox)
|
(all nixos.tests.firefox)
|
||||||
(all nixos.tests.firewall)
|
(all nixos.tests.firewall)
|
||||||
(all nixos.tests.gnome3)
|
(all nixos.tests.gnome3)
|
||||||
|
@ -19,7 +19,8 @@ let
|
|||||||
callTestOnTheseSystems = systems: fn: args: forTheseSystems systems (system: hydraJob (importTest fn args system));
|
callTestOnTheseSystems = systems: fn: args: forTheseSystems systems (system: hydraJob (importTest fn args system));
|
||||||
callTest = callTestOnTheseSystems supportedSystems;
|
callTest = callTestOnTheseSystems supportedSystems;
|
||||||
|
|
||||||
callSubTests = fn: args: let
|
callSubTests = callSubTestsOnTheseSystems supportedSystems;
|
||||||
|
callSubTestsOnTheseSystems = systems: fn: args: let
|
||||||
discover = attrs: let
|
discover = attrs: let
|
||||||
subTests = filterAttrs (const (hasAttr "test")) attrs;
|
subTests = filterAttrs (const (hasAttr "test")) attrs;
|
||||||
in mapAttrs (const (t: hydraJob t.test)) subTests;
|
in mapAttrs (const (t: hydraJob t.test)) subTests;
|
||||||
@ -28,10 +29,7 @@ let
|
|||||||
${system} = test;
|
${system} = test;
|
||||||
}) (discover (importTest fn args system));
|
}) (discover (importTest fn args system));
|
||||||
|
|
||||||
# If the test is only for a particular system, use only the specified
|
in foldAttrs mergeAttrs {} (map discoverForSystem (intersectLists systems supportedSystems));
|
||||||
# system instead of generating attributes for all available systems.
|
|
||||||
in if args ? system then discover (import fn args)
|
|
||||||
else foldAttrs mergeAttrs {} (map discoverForSystem supportedSystems);
|
|
||||||
|
|
||||||
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
||||||
|
|
||||||
@ -230,7 +228,7 @@ in rec {
|
|||||||
tests.boot = callSubTests tests/boot.nix {};
|
tests.boot = callSubTests tests/boot.nix {};
|
||||||
tests.boot-stage1 = callTest tests/boot-stage1.nix {};
|
tests.boot-stage1 = callTest tests/boot-stage1.nix {};
|
||||||
tests.cadvisor = callTestOnTheseSystems ["x86_64-linux"] tests/cadvisor.nix {};
|
tests.cadvisor = callTestOnTheseSystems ["x86_64-linux"] tests/cadvisor.nix {};
|
||||||
tests.chromium = (callSubTests tests/chromium.nix { system = "x86_64-linux"; }).stable;
|
tests.chromium = (callSubTestsOnTheseSystems ["x86_64-linux"] tests/chromium.nix {}).stable;
|
||||||
tests.cjdns = callTest tests/cjdns.nix {};
|
tests.cjdns = callTest tests/cjdns.nix {};
|
||||||
tests.cloud-init = callTest tests/cloud-init.nix {};
|
tests.cloud-init = callTest tests/cloud-init.nix {};
|
||||||
tests.containers-ipv4 = callTest tests/containers-ipv4.nix {};
|
tests.containers-ipv4 = callTest tests/containers-ipv4.nix {};
|
||||||
@ -250,9 +248,9 @@ in rec {
|
|||||||
tests.dnscrypt-proxy = callTestOnTheseSystems ["x86_64-linux"] tests/dnscrypt-proxy.nix {};
|
tests.dnscrypt-proxy = callTestOnTheseSystems ["x86_64-linux"] tests/dnscrypt-proxy.nix {};
|
||||||
tests.ecryptfs = callTest tests/ecryptfs.nix {};
|
tests.ecryptfs = callTest tests/ecryptfs.nix {};
|
||||||
tests.etcd = callTestOnTheseSystems ["x86_64-linux"] tests/etcd.nix {};
|
tests.etcd = callTestOnTheseSystems ["x86_64-linux"] tests/etcd.nix {};
|
||||||
tests.ec2-nixops = hydraJob (import tests/ec2.nix { system = "x86_64-linux"; }).boot-ec2-nixops;
|
tests.ec2-nixops = (callSubTestsOnTheseSystems ["x86_64-linux"] tests/ec2.nix {}).boot-ec2-nixops;
|
||||||
tests.ec2-config = hydraJob (import tests/ec2.nix { system = "x86_64-linux"; }).boot-ec2-config;
|
tests.ec2-config = (callSubTestsOnTheseSystems ["x86_64-linux"] tests/ec2.nix {}).boot-ec2-config;
|
||||||
tests.elk = callSubTests tests/elk.nix { system = "x86_64-linux"; };
|
tests.elk = callSubTestsOnTheseSystems ["x86_64-linux"] tests/elk.nix {};
|
||||||
tests.env = callTest tests/env.nix {};
|
tests.env = callTest tests/env.nix {};
|
||||||
tests.ferm = callTest tests/ferm.nix {};
|
tests.ferm = callTest tests/ferm.nix {};
|
||||||
tests.firefox = callTest tests/firefox.nix {};
|
tests.firefox = callTest tests/firefox.nix {};
|
||||||
@ -346,7 +344,7 @@ in rec {
|
|||||||
tests.tomcat = callTest tests/tomcat.nix {};
|
tests.tomcat = callTest tests/tomcat.nix {};
|
||||||
tests.udisks2 = callTest tests/udisks2.nix {};
|
tests.udisks2 = callTest tests/udisks2.nix {};
|
||||||
tests.vault = callTest tests/vault.nix {};
|
tests.vault = callTest tests/vault.nix {};
|
||||||
tests.virtualbox = callSubTests tests/virtualbox.nix { system = "x86_64-linux"; };
|
tests.virtualbox = callSubTestsOnTheseSystems ["x86_64-linux"] tests/virtualbox.nix {};
|
||||||
tests.wordpress = callTest tests/wordpress.nix {};
|
tests.wordpress = callTest tests/wordpress.nix {};
|
||||||
tests.xfce = callTest tests/xfce.nix {};
|
tests.xfce = callTest tests/xfce.nix {};
|
||||||
tests.xmonad = callTest tests/xmonad.nix {};
|
tests.xmonad = callTest tests/xmonad.nix {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user