about summary refs log tree commit diff
path: root/release.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2015-12-11 07:34:35 +0100
committeraszlig <aszlig@redmoonstudios.org>2015-12-11 07:34:35 +0100
commitaa6741135cb7e78ab038eee798067f2df32bb6d9 (patch)
treec89fdc06e3ba3918aa1915366bedbf5756fcd4e2 /release.nix
parentf48fe4b7f4509c919e3897e83490da34a095d0fc (diff)
modules: Make requiresTests a list of paths.
Unfortunately, we went into trouble and the Hydra machine not only
consumed lots of ram during evaluation but it also triggered a bunch of
evaluation errors because the available tests were strictly evaluated.

Using attribute paths consisting of plain strings doesn't have the same
problem, even though they look a bit uglier.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'release.nix')
-rw-r--r--release.nix16
1 files changed, 5 insertions, 11 deletions
diff --git a/release.nix b/release.nix
index 2d5d9641..fc72ee2b 100644
--- a/release.nix
+++ b/release.nix
@@ -62,21 +62,15 @@ in with pkgsUpstream.lib; with builtins; {
   in mapAttrsRecursiveCond (m: !(m ? iso)) (const buildIso) allMachines;
 
   tests = let
+    machineList = collect (m: m ? build) allMachines;
     allTests = import ./lib/get-tests.nix {
       inherit system nixpkgs;
     };
-    machineList = collect (m: m ? build) allMachines;
-    activatedTests = concatMap (machine:
+    activatedTests = unique (concatMap (machine:
       machine.build.config.vuizvui.requiresTests
-    ) [ (head machineList) ];
-    cmpTest = a: b:
-      if a ? driver
-      then a.driver.testScript == b.driver.testScript && a.name == b.name
-      else a.drvPath == b.drvPath;
-    hasTest = test: any (cmpTest test) activatedTests;
-    includeTest = test: optionalAttrs (hasTest test) test;
-    cond = t: !((t.type or null) == "derivation" || t ? test);
-  in mapAttrsRecursiveCond cond (const includeTest) allTests;
+    ) machineList);
+    mkTest = path: setAttrByPath path (getAttrFromPath path allTests);
+  in fold recursiveUpdate {} (map mkTest activatedTests);
 
   pkgs = let
     releaseLib = import "${nixpkgs}/pkgs/top-level/release-lib.nix" {