2024-11-02 17:58:52 +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 20:24:48 +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; {
|
|
|
|
maintainers = [ spinus willibutz ];
|
2017-02-26 10:14:32 +00:00
|
|
|
};
|
|
|
|
|
2024-11-02 20:24:48 +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;
|
|
|
|
extraPlugins = ps: with ps; [ pgjwt pgtap ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
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"
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
2024-11-02 17:58:52 +00:00
|
|
|
lib.recurseIntoAttrs (
|
2024-11-02 20:24:48 +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
|
|
|
}
|
|
|
|
)
|