Skip to content

Commit da0a9fc

Browse files
authored
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 <[email protected]> --------- Co-authored-by: Sam Rose <[email protected]>
1 parent 74e3390 commit da0a9fc

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

flake.nix

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -505,23 +505,30 @@
505505
export PGDATA=/tmp/pgdata
506506
mkdir -p $PGDATA
507507
initdb --locale=C
508-
509508
substitute ${./nix/tests/postgresql.conf.in} $PGDATA/postgresql.conf \
510-
--subst-var-by PGSODIUM_GETKEY_SCRIPT "${./nix/tests/util/pgsodium_getkey.sh}"
511-
512-
postgres -k /tmp >logfile 2>&1 &
513-
sleep 2
514-
509+
--subst-var-by PGSODIUM_GETKEY_SCRIPT "${./nix/tests/util/pgsodium_getkey_arb.sh}"
510+
echo "listen_addresses = '*'" >> $PGDATA/postgresql.conf
511+
echo "port = 5432" >> $PGDATA/postgresql.conf
512+
echo "host all all 127.0.0.1/32 trust" >> $PGDATA/pg_hba.conf
513+
postgres -k /tmp -h localhost >logfile 2>&1 &
514+
for i in {1..30}; do
515+
if pg_isready -h localhost; then
516+
break
517+
fi
518+
sleep 1
519+
if [ $i -eq 30 ]; then
520+
echo "PostgreSQL is not ready after 30 seconds"
521+
cat logfile
522+
exit 1
523+
fi
524+
done
515525
createdb -h localhost testing
516-
517526
psql -h localhost -d testing -Xaf ${./nix/tests/prime.sql}
518527
pg_prove -h localhost -d testing ${sqlTests}/*.sql
519-
520528
pkill postgres
521529
mv logfile $out
522530
echo ${pgpkg}
523531
'';
524-
525532
in
526533
rec {
527534
# The list of all packages that can be built with 'nix build'. The list

nix/ext/wrappers/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ buildPgrxExtension_0_11_3 rec {
5454
"s3_fdw"
5555
"airtable_fdw"
5656
"logflare_fdw"
57+
"auth0_fdw"
5758
];
5859

5960
# FIXME (aseipp): disable the tests since they try to install .control

nix/tests/util/pgsodium_getkey_arb.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
echo -n 8359dafbba5c05568799c1c24eb6c2fbff497654bc6aa5e9a791c666768875a1

0 commit comments

Comments
 (0)