From f60768b6cda4e48c1905649868592c7b080fa355 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 16 Apr 2022 17:39:19 +0200 Subject: [PATCH] haskellPackages.persistent-postgresql: Enable tests --- .../haskell-modules/configuration-common.nix | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 0bff301224c..66bd34bdbc0 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -1331,7 +1331,25 @@ self: super: { # Test suite requires database persistent-mysql = dontCheck super.persistent-mysql; - persistent-postgresql = dontCheck super.persistent-postgresql; + persistent-postgresql = + overrideCabal + (drv: { + postPatch = drv.postPath or "" + '' + # patch out TCP usage: https://nixos.org/manual/nixpkgs/stable/#sec-postgresqlTestHook-tcp + # NOTE: upstream host variable takes only two values... + sed -i test/PgInit.hs \ + -e s^'host=" <> host <> "'^^ + ''; + preCheck = drv.preCheck or "" + '' + PGDATABASE=test + PGUSER=test + ''; + testToolDepends = drv.testToolDepends or [] ++ [ + pkgs.postgresql + pkgs.postgresqlTestHook + ]; + }) + super.persistent-postgresql; # Fix EdisonAPI and EdisonCore for GHC 8.8: # https://github.com/robdockins/edison/pull/16