Skip to content

Commit 3ff4596

Browse files
authored
Merge pull request #615 from mmlb/push-kmwurkqvtrkv
Pass flags to gotest
2 parents 34e0cda + 19adc97 commit 3ff4596

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

modules/hooks.nix

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,20 @@ in
628628
};
629629
};
630630
};
631+
gotest = mkOption {
632+
description = "gotest hook";
633+
type = types.submodule {
634+
imports = [ hookModule ];
635+
options.settings = {
636+
flags = mkOption {
637+
type = types.str;
638+
description = "Flags passed to gotest. See all available [here](https://pkg.go.dev/cmd/go#hdr-Test_packages).";
639+
default = "";
640+
example = "-tags integration";
641+
};
642+
};
643+
};
644+
};
631645
headache = mkOption {
632646
description = "headache hook";
633647
type = types.submodule {
@@ -2898,7 +2912,7 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.fourm
28982912
28992913
# test each directory one by one
29002914
for dir in "''${sorted_dirs[@]}"; do
2901-
${hooks.gotest.package}/bin/go test "./$dir"
2915+
${hooks.gotest.package}/bin/go test ${hooks.gotest.settings.flags} "./$dir"
29022916
done
29032917
'';
29042918
in

0 commit comments

Comments
 (0)