2024-11-02 22:04:45 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
makeTest,
|
2024-11-01 18:34:26 +00:00
|
|
|
}:
|
2019-11-06 15:45:57 +00:00
|
|
|
|
2024-11-01 18:34:26 +00:00
|
|
|
let
|
|
|
|
inherit (pkgs) lib;
|
|
|
|
|
2024-11-02 22:04:45 +00:00
|
|
|
makeTestFor =
|
|
|
|
package:
|
2024-11-01 18:34:26 +00:00
|
|
|
makeTest {
|
2024-11-02 20:24:48 +00:00
|
|
|
name = "pgjwt-${package.name}";
|
2024-11-01 18:34:26 +00:00
|
|
|
meta = with lib.maintainers; {
|
2024-11-02 22:04:45 +00:00
|
|
|
maintainers = [
|
|
|
|
spinus
|
|
|
|
willibutz
|
|
|
|
];
|
2017-02-26 10:14:32 +00:00
|
|
|
};
|
|
|
|
|
2024-11-02 22:04:45 +00:00
|
|
|
nodes.master =
|
|
|
|
{ ... }:
|
2024-11-01 18:34:26 +00:00
|
|
|
{
|
|
|
|
services.postgresql = {
|
2024-11-02 20:24:48 +00:00
|
|
|
inherit package;
|
2024-11-01 18:34:26 +00:00
|
|
|
enable = true;
|
2024-11-12 20:02:10 +00:00
|
|
|
enableJIT = lib.hasInfix "-jit-" package.name;
|
2024-11-11 22:23:46 +00:00
|
|
|
extensions =
|
2024-11-02 22:04:45 +00:00
|
|
|
ps: with ps; [
|
|
|
|
pgjwt
|
|
|
|
pgtap
|
|
|
|
];
|
2024-11-01 18:34:26 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-11-02 22:04:45 +00:00
|
|
|
testScript =
|
|
|
|
{ nodes, ... }:
|
|
|
|
let
|
|
|
|
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.sudo}/bin/sudo -u ${sqlSU} ${pgProve}/bin/pg_prove -d postgres -v -f ${pgjwt.src}/test.sql"
|
|
|
|
)
|
|
|
|
'';
|
2024-11-01 18:34:26 +00:00
|
|
|
};
|
|
|
|
in
|
2024-11-02 17:58:52 +00:00
|
|
|
lib.recurseIntoAttrs (
|
2024-11-02 22:04:45 +00:00
|
|
|
lib.concatMapAttrs (n: p: { ${n} = makeTestFor p; }) (
|
|
|
|
lib.filterAttrs (_: p: !p.pkgs.pgjwt.meta.broken) pkgs.postgresqlVersions
|
|
|
|
)
|
2024-11-02 17:58:52 +00:00
|
|
|
// {
|
2024-11-02 20:24:48 +00:00
|
|
|
passthru.override = p: makeTestFor p;
|
2024-11-02 17:58:52 +00:00
|
|
|
}
|
|
|
|
)
|