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:
parent
db2d6a00ab
commit
9035573855
23 changed files with 166 additions and 154 deletions
46
nixos/tests/postgresql/pgjwt.nix
Normal file
46
nixos/tests/postgresql/pgjwt.nix
Normal 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;
|
||||
}
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue