supabase-postgres.git / summary / log / commit / refs
commit da0a9fccef6c17015e392a2b9ca5960761a31bca
Author: samrose <samuel.rose@gmail.com>
Commit: GitHub <noreply@github.com>
Date: Sat Jul 20 15:48:50 2024 +0000
fix: flake check was broken/could not start postgres (#1063)
* fix: flake check was broken/coul not start postgres
* fix: buildFeature missing at least auth0_fdw (#1064)
Co-authored-by: Sam Rose <samuel@supabase.io>
---------
Co-authored-by: Sam Rose <samuel@supabase.io>
flake.nix | 25 ++++++++++++++++---------
nix/ext/wrappers/default.nix | 1 +
nix/tests/util/pgsodium_getkey_arb.sh | 1 +
3 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/flake.nix b/flake.nix
index 4a2c85b9..1ced4ab0 100644
--- a/flake.nix
+++ b/flake.nix
@@ -505,23 +505,30 @@
export PGDATA=/tmp/pgdata
mkdir -p $PGDATA
initdb --locale=C
-
substitute ${./nix/tests/postgresql.conf.in} $PGDATA/postgresql.conf \
- --subst-var-by PGSODIUM_GETKEY_SCRIPT "${./nix/tests/util/pgsodium_getkey.sh}"
-
- postgres -k /tmp >logfile 2>&1 &
- sleep 2
-
+ --subst-var-by PGSODIUM_GETKEY_SCRIPT "${./nix/tests/util/pgsodium_getkey_arb.sh}"
+ echo "listen_addresses = '*'" >> $PGDATA/postgresql.conf
+ echo "port = 5432" >> $PGDATA/postgresql.conf
+ echo "host all all 127.0.0.1/32 trust" >> $PGDATA/pg_hba.conf
+ postgres -k /tmp -h localhost >logfile 2>&1 &
+ for i in {1..30}; do
+ if pg_isready -h localhost; then
+ break
+ fi
+ sleep 1
+ if [ $i -eq 30 ]; then
+ echo "PostgreSQL is not ready after 30 seconds"
+ cat logfile
+ exit 1
+ fi
+ done
createdb -h localhost testing
-
psql -h localhost -d testing -Xaf ${./nix/tests/prime.sql}
pg_prove -h localhost -d testing ${sqlTests}/*.sql
-
pkill postgres
mv logfile $out
echo ${pgpkg}
'';
-
in
rec {
# The list of all packages that can be built with 'nix build'. The list
diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix
index c6864165..f934f9c0 100644
--- a/nix/ext/wrappers/default.nix
+++ b/nix/ext/wrappers/default.nix
@@ -54,6 +54,7 @@ buildPgrxExtension_0_11_3 rec {
"s3_fdw"
"airtable_fdw"
"logflare_fdw"
+ "auth0_fdw"
];
# FIXME (aseipp): disable the tests since they try to install .control
diff --git a/nix/tests/util/pgsodium_getkey_arb.sh b/nix/tests/util/pgsodium_getkey_arb.sh
new file mode 100755
index 00000000..446dbba2
--- /dev/null
+++ b/nix/tests/util/pgsodium_getkey_arb.sh
@@ -0,0 +1 @@
+echo -n 8359dafbba5c05568799c1c24eb6c2fbff497654bc6aa5e9a791c666768875a1
\ No newline at end of file
[parent: 74e33907086e]