about summary refs log tree commit diff
path: root/nix
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2021-09-14T22·17+0200
committersterni <sternenseemann@systemli.org>2021-09-17T11·47+0000
commit5dec98233482ebd651f9be77984a178d6656efe4 (patch)
tree9ec268ac5429162f8327ce979552971be15749c5 /nix
parentbef796d1d94034be36fdcb14b977fdc822fd2823 (diff)
refactor(nix/runTestsuite): clean up runTestsuite r/2881
* goodAss wasn't used before. Simplify it to just return a boolean, so
  we can use it for partitionTests later.

* goodIt also returns unnecessary extra meta information which is not
  used. Cleaning that up makes the condition extremely small, so we can
  inline it into (what was) goodIts.

* goodIts is just called in one place, so we can inline it into res.

Change-Id: I70cf4fa3f61ce1467a2ee5319f841cdd42db6a66
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3548
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
Diffstat (limited to 'nix')
-rw-r--r--nix/runTestsuite/default.nix22
1 files changed, 6 insertions, 16 deletions
diff --git a/nix/runTestsuite/default.nix b/nix/runTestsuite/default.nix
index dc8e40f8ad4b..f9a156047928 100644
--- a/nix/runTestsuite/default.nix
+++ b/nix/runTestsuite/default.nix
@@ -140,23 +140,13 @@ let
   runTestsuite = defun [ string (list ItResult) drv ]
     (name: itResults:
       let
-        goodAss = ass: {
-          good = AssertResult.match ass {
-            yep = _: true;
-            nope = _: false;
-          };
-          x = ass;
+        goodAss = ass: AssertResult.match ass {
+          yep = _: true;
+          nope = _: false;
         };
-        goodIt = it: {
-          inherit (it) it-desc;
-          asserts = partitionTests (ass:
-            AssertResult.match ass {
-              yep = _: true;
-              nope = _: false;
-            }) it.asserts;
-        };
-        goodIts = partitionTests (it: (goodIt it).asserts.err == []);
-        res = goodIts itResults;
+        res = partitionTests (it:
+          (partitionTests goodAss it.asserts).err == []
+        ) itResults;
         prettyRes = lib.generators.toPretty {} res;
       in
         if res.err == []