Fix issue with testWrapper (exposed by #238) (#243)
* Fix issue with testWrapper (exposed by #238)
We were relying on the `string` type's merge function quietly
concatenating strings.
Described here:
https://github.com/NixOS/nixpkgs/blob/700cc56a0e7e1daf7410420ac66978ae3225fbb2/lib/types.nix#L218-L221
commitf5b80ecf0e3ec5320a4ca6e3ec36f91867bd0bdc
authorHamish Mackenzie <Hamish.Mackenzie@iohk.io>
dateMon 16 Sep 2019, 14:40 (7 years ago)
parent5f6fbe6
builder/comp-builder.nix+1−1
@@ -197,7 +197,7 @@ stdenv.mkDerivation ({
197197 checkPhase = ''
198198 runHook preCheck
199199
200− ${component.testWrapper} ${testExecutable} ${lib.concatStringsSep " " component.testFlags}
200+ ${toString component.testWrapper} ${testExecutable} ${lib.concatStringsSep " " component.testFlags}
201201
202202 runHook postCheck
203203 '';
modules/plan.nix+4−2
@@ -130,8 +130,10 @@ let
130130 };
131131 # Wrapper for test executable run in checkPhase
132132 testWrapper = mkOption {
133− type = str;
134− default = (def.testWrapper or "");
133+ type = nullOr str;
134+ default = def.testWrapper or null;
135+ description = "A command to run for executing tests in checkPhase, which takes the original test command as its arguments.";
136+ example = "echo";
135137 };
136138 postCheck = mkOption {
137139 type = nullOr str;