From f48fe4b7f4509c919e3897e83490da34a095d0fc Mon Sep 17 00:00:00 2001 From: aszlig Date: Fri, 11 Dec 2015 07:03:57 +0100 Subject: 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 --- release.nix | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'release.nix') 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" { -- cgit 1.4.1