Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: flake check was broken/could not start postgres #1063

Merged
merged 2 commits into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions nix/ext/wrappers/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions nix/tests/util/pgsodium_getkey_arb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
echo -n 8359dafbba5c05568799c1c24eb6c2fbff497654bc6aa5e9a791c666768875a1
Loading