about summary refs log tree commit diff
path: root/pkgs/build-support/setup-hooks/postgresql-test-hook
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2023-01-25 12:01:34 +0000
committerGitHub <noreply@github.com>2023-01-25 12:01:34 +0000
commit20df8d00cc2e95ebfc7503f6cfc11ff05d0db403 (patch)
tree96a67882d22cd900e2a44e527d29538ac21b5dca /pkgs/build-support/setup-hooks/postgresql-test-hook
parenta2f216a00334b1350df235e7c6613c6f3e9022af (diff)
parent55e19102526fba191a5aa4b8dc4529bd3af298e2 (diff)
Merge master into staging-next
Diffstat (limited to 'pkgs/build-support/setup-hooks/postgresql-test-hook')
-rw-r--r--pkgs/build-support/setup-hooks/postgresql-test-hook/postgresql-test-hook.sh2
-rw-r--r--pkgs/build-support/setup-hooks/postgresql-test-hook/test.nix5
2 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/build-support/setup-hooks/postgresql-test-hook/postgresql-test-hook.sh b/pkgs/build-support/setup-hooks/postgresql-test-hook/postgresql-test-hook.sh
index b85d4203480f7..3eec67d60feb4 100644
--- a/pkgs/build-support/setup-hooks/postgresql-test-hook/postgresql-test-hook.sh
+++ b/pkgs/build-support/setup-hooks/postgresql-test-hook/postgresql-test-hook.sh
@@ -71,6 +71,8 @@ EOF
   echo 'setting up postgresql'
   eval "$postgresqlTestSetupCommands"
 
+  runHook postgresqlTestSetupPost
+
 }
 
 postgresqlStop() {
diff --git a/pkgs/build-support/setup-hooks/postgresql-test-hook/test.nix b/pkgs/build-support/setup-hooks/postgresql-test-hook/test.nix
index adb65fca7ca6d..9881ed1016cc1 100644
--- a/pkgs/build-support/setup-hooks/postgresql-test-hook/test.nix
+++ b/pkgs/build-support/setup-hooks/postgresql-test-hook/test.nix
@@ -14,6 +14,9 @@ stdenv.mkDerivation {
     INSERT INTO hello VALUES ('it '||'worked');
     SELECT * FROM hello;
   '';
+  postgresqlTestSetupPost = ''
+    TEST_POST_HOOK_RAN=1
+  '';
   checkPhase = ''
     runHook preCheck
     psql <$sqlPath | grep 'it worked'
@@ -21,7 +24,7 @@ stdenv.mkDerivation {
     runHook postCheck
   '';
   installPhase = ''
-    [[ $TEST_RAN == 1 ]]
+    [[ $TEST_RAN == 1 && $TEST_POST_HOOK_RAN == 1 ]]
     touch $out
   '';
 }