about summary refs log tree commit diff
path: root/release.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2015-12-11 07:03:57 +0100
committeraszlig <aszlig@redmoonstudios.org>2015-12-11 07:03:57 +0100
commitf48fe4b7f4509c919e3897e83490da34a095d0fc (patch)
tree2df02322cd780e030f4146f0da31796c1c77b33b /release.nix
parent0478b94d658a08904d3e41ff615a52775e65c085 (diff)
release.nix: Include all tests that are enabled.
This now includes both upstream NixOS and Vuizvui tests.

Unfortunately, evaluation now takes a ton of time and also a ton of
memory, so let's hope our Hydra can sustain it. The reason is that we
need to look through all of the available tests and recurse through
_all_ machine configurations to see if they're defined there.

If it is too heavyweight we might need to find a better solution for
that.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'release.nix')
-rw-r--r--release.nix18
1 files changed, 16 insertions, 2 deletions
diff --git a/release.nix b/release.nix
index b666ae67..2d5d9641 100644
--- a/release.nix
+++ b/release.nix
@@ -61,8 +61,22 @@ in with pkgsUpstream.lib; with builtins; {
     '';
   in mapAttrsRecursiveCond (m: !(m ? iso)) (const buildIso) allMachines;
 
-  tests = mapAttrsRecursiveCond (t: !(t ? test)) (const id)
-    (import "${vuizvui}/tests" { inherit system; });
+  tests = let
+    allTests = import ./lib/get-tests.nix {
+      inherit system nixpkgs;
+    };
+    machineList = collect (m: m ? build) allMachines;
+    activatedTests = 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;
 
   pkgs = let
     releaseLib = import "${nixpkgs}/pkgs/top-level/release-lib.nix" {