about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2015-12-11 07:02:02 +0100
committeraszlig <aszlig@redmoonstudios.org>2015-12-11 07:02:02 +0100
commit0478b94d658a08904d3e41ff615a52775e65c085 (patch)
treedc2f08376c8f89e68cc32f94adf39a127ddf1e00 /lib
parentb4002136515ab1ab93f0be92902cd203f54e8fea (diff)
lib/get-test: Fix collecting upstream NixOS tests.
The upstream tests all have their attributes cleaned up by the
"hydraJob" function, so we can't check for the "test" attribute.

Luckily this isn't a problem, because we're only searching for "anything
not plain attribute namespacing" anyway.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/get-tests.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/get-tests.nix b/lib/get-tests.nix
index 22d85b12..0f93a5bb 100644
--- a/lib/get-tests.nix
+++ b/lib/get-tests.nix
@@ -7,9 +7,10 @@ with import "${nixpkgs}/lib";
     upstreamTests = (import "${nixpkgs}/nixos/release.nix" {
       inherit nixpkgs;
     }).tests;
-    isTestOrSystems = attr: attr ? test || attr ? ${system};
+    isTestOrJob = attr: (attr.type or null) == "derivation" || attr ? test;
+    isTestOrSystems = attr: isTestOrJob attr || attr ? ${system};
     cond = attr: !isTestOrSystems attr;
-    reduce = attr: if attr ? test then attr else attr.${system};
+    reduce = attr: if isTestOrJob attr then attr else attr.${system};
   in mapAttrsRecursiveCond cond (path: reduce) upstreamTests;
 
   vuizvui = import ../tests {