diff --git a/lib/testing.nix b/lib/testing.nix index 834fa04ec0b0..1b0c3889190e 100644 --- a/lib/testing.nix +++ b/lib/testing.nix @@ -80,5 +80,19 @@ rec { ensureDir $out/nix-support echo "report coverage $out/coverage" >> $out/nix-support/hydra-build-products ''; # */ - + + call = f: f { inherit pkgs nixpkgs system; }; + + apply = testFun: complete (call testFun); + + complete = t: t // rec { + nodes = + if t ? nodes then t.nodes else + if t ? machine then { machine = t.machine; } + else { }; + vms = buildVirtualNetwork { inherit nodes; }; + test = runTests vms t.testScript; + report = makeReport test; + }; + } diff --git a/tests/default.nix b/tests/default.nix index a9661d339573..9c058ccadcc3 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -9,23 +9,7 @@ let (import ../lib/build-vms.nix { inherit nixpkgs services system; }) // (import ../lib/testing.nix { inherit nixpkgs services system; }); -in with testLib; let - - call = f: f { inherit pkgs nixpkgs system testLib; }; - - apply = testFun: complete (call testFun); - - complete = t: t // rec { - nodes = - if t ? nodes then t.nodes else - if t ? machine then { machine = t.machine; } - else { }; - vms = buildVirtualNetwork { inherit nodes; }; - test = runTests vms t.testScript; - report = makeReport test; - }; - -in +in with testLib; { firefox = apply (import ./firefox.nix);