From 3c09cb23639c185f3b168b56bfc83ab3768dd1e0 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 6 Jun 2022 20:19:59 +0200 Subject: [PATCH] nixos/all-tests.nix: Improve runTest for release.nix ... and add runTestOn. --- nixos/tests/all-tests.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index e0121fe6b6b..eb13e33bd9a 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -27,6 +27,22 @@ let }; evalMinimalConfig = module: nixosLib.evalModules { modules = [ module ]; }; + inherit + (rec { + doRunTest = (import ../lib/testing-python.nix { inherit system pkgs; }).runTest; + findTests = tree: + if tree?recurseForDerivations && tree.recurseForDerivations + then mapAttrs (k: findTests) (builtins.removeAttrs tree ["recurseForDerivations"]) + else callTest ({ test = tree; }); + runTest = arg: let r = doRunTest arg; in findTests r; + runTestOn = systems: arg: + if elem system systems then runTest arg + else {}; + }) + runTest + runTestOn + ; + in { _3proxy = handleTest ./3proxy.nix {}; acme = handleTest ./acme.nix {};