···10201020: Sets `doCheck` to `false` for `drv`. Useful if a package has a broken,
10211021flaky or otherwise problematic test suite breaking the build.
1022102210231023+`dontCheckIf condition drv`
10241024+: Sets `doCheck` to `false` for `drv`, but only if `condition` applies.
10251025+Otherwise it's a no-op. Useful to conditionally disable tests for a package
10261026+without interfering with previous overrides or default values.
10271027+10231028<!-- Purposefully omitting the non-list variants here. They are a bit
10241029ugly, and we may want to deprecate them at some point. -->
10251030
···11031103 rel8 = pkgs.lib.pipe super.rel8 [
11041104 (addTestToolDepend pkgs.postgresql)
11051105 # https://github.com/NixOS/nixpkgs/issues/198495
11061106- (overrideCabal (lib.optionalAttrs (!pkgs.postgresql.doCheck) { doCheck = false; }))
11061106+ (dontCheckIf (!pkgs.postgresql.doCheck))
11071107 ];
1108110811091109 # Wants running postgresql database accessible over ip, so postgresqlTestHook
···1178117811791179 # Some hash implementations are x86 only, but part of the test suite.
11801180 # So executing and building it on non-x86 platforms will always fail.
11811181- hashes = overrideCabal (lib.optionalAttrs (!pkgs.stdenv.hostPlatform.isx86) {
11821182- doCheck = false;
11831183- }) super.hashes;
11811181+ hashes = dontCheckIf (!pkgs.stdenv.hostPlatform.isx86) super.hashes;
1184118211851183 # Tries to access network
11861184 aws-sns-verify = dontCheck super.aws-sns-verify;
+5
pkgs/development/haskell-modules/lib/compose.nix
···108108 of test suites listed in the package description file.
109109 */
110110 dontCheck = overrideCabal (drv: { doCheck = false; });
111111+ /* The dontCheckIf variant sets doCheck = false if the condition
112112+ applies. In any other case the previously set/default value is used.
113113+ This prevents accidentally re-enabling tests in a later override.
114114+ */
115115+ dontCheckIf = condition: if condition then dontCheck else lib.id;
111116112117 /* doBenchmark enables dependency checking and compilation
113118 for benchmarks listed in the package description file.
+5
pkgs/development/haskell-modules/lib/default.nix
···105105 of test suites listed in the package description file.
106106 */
107107 dontCheck = compose.dontCheck;
108108+ /* The dontCheckIf variant sets doCheck = false if the condition
109109+ applies. In any other case the previously set/default value is used.
110110+ This prevents accidentally re-enabling tests in a later override.
111111+ */
112112+ dontCheckIf = drv: condition: compose.dontCheckIf condition drv;
108113109114 /* doBenchmark enables dependency checking, compilation and execution
110115 for benchmarks listed in the package description file.