0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

nixosTests.postgresql: move all postgresql related nixosTests into one folder

This makes it possible to run all those tests at once by building
nixosTests.postgresql and allow a simple entry to ci/OWNERS for all
tests.
This commit is contained in:
Wolfgang Walther 2024-11-02 18:58:52 +01:00
parent db2d6a00ab
commit 9035573855
No known key found for this signature in database
GPG key ID: B39893FA5F65CAE1
23 changed files with 166 additions and 154 deletions

View file

@ -0,0 +1,46 @@
{ pkgs
, makeTest
}:
let
inherit (pkgs) lib;
makePgjwtTest = postgresqlPackage:
makeTest {
name = "pgjwt-${postgresqlPackage.name}";
meta = with lib.maintainers; {
maintainers = [ spinus willibutz ];
};
nodes = {
master = { ... }:
{
services.postgresql = {
enable = true;
package = postgresqlPackage;
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
lib.recurseIntoAttrs (
lib.concatMapAttrs (n: p: { ${n} = makePgjwtTest p; }) pkgs.postgresqlVersions
// {
passthru.override = p: makePgjwtTest p;
}
)