nixos/pgjwt: fix test

This commit is contained in:
Maximilian Bosch 2024-09-24 23:26:58 +02:00
parent 37ac1256c4
commit bc21f77ff6
No known key found for this signature in database

View File

@ -18,17 +18,15 @@ with pkgs; {
testScript = { nodes, ... }:
let
sqlSU = "${nodes.master.config.services.postgresql.superUser}";
sqlSU = "${nodes.master.services.postgresql.superUser}";
pgProve = "${pkgs.perlPackages.TAPParserSourceHandlerpgTAP}";
inherit (nodes.master.services.postgresql.package.pkgs) pgjwt;
in
''
start_all()
master.wait_for_unit("postgresql")
master.succeed(
"${pkgs.gnused}/bin/sed -e '12 i CREATE EXTENSION pgcrypto;\\nCREATE EXTENSION pgtap;\\nSET search_path TO tap,public;' ${pgjwt.src}/test.sql > /tmp/test.sql"
)
master.succeed(
"${pkgs.sudo}/bin/sudo -u ${sqlSU} PGOPTIONS=--search_path=tap,public ${pgProve}/bin/pg_prove -d postgres -v -f /tmp/test.sql"
"${pkgs.sudo}/bin/sudo -u ${sqlSU} PGOPTIONS=--search_path=tap,public ${pgProve}/bin/pg_prove -d postgres -v -f ${pgjwt.src}/test.sql"
)
'';
})