From 8651143b791b611ec185fcfed626dff085f7e032 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 21 Sep 2021 14:24:40 +0200 Subject: [PATCH] Revert "Add packageTests" This reverts commit 87b3740d66b369e4e447f3fcb58a657a268f213d. packageTests wasn't inherently wrong, but I am not fully convinced that it is necessary. Specifically, it would only be used by: - `nix-build`, which is going to be a legacy command in the mid term - ofborg, perhaps, not even implemented whereas the following use cases do not need it: - `nix build` (experimental command with a future, unlike `nix-build`) - `release.nix` (Hydra), might use similar logic but not reuse this Further, considering that this is only necessary for tests of functions, I am hesitant to introduce it. Meanwhile, it should not hinder the rest of the PR. --- pkgs/top-level/all-packages.nix | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 13027f2104b0..de79cc3014c2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -119,24 +119,6 @@ with pkgs; callTest = t: t.test; }; - ### Traversal for package tests - - # Whereas most tests can be run with `nix-build -A my-package.tests`, this - # does not work for tests on a __functor attrset. - # TODO: enable these on hydra.nixos.org? - packageTests = let - getTests = attrs: - if builtins.typeOf attrs != "set" - then {} - else if lib.isDerivation attrs - then lib.recurseIntoAttrs attrs.tests or {} - else if attrs?__functor - then lib.recurseIntoAttrs attrs.tests or {} - else lib.mapAttrs (k: if k == "recurseForDerivations" then v: v else getTests) attrs; - in - getTests pkgs; - - ### BUILD SUPPORT auditBlasHook = makeSetupHook