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

nixosTests.postgresql: use a common pattern throughout all tests

Avoiding "with", using the same names and basic structure in each test.

Consistency is key!
This commit is contained in:
Wolfgang Walther 2024-11-02 21:24:48 +01:00
parent 9035573855
commit 128244b598
No known key found for this signature in database
GPG key ID: B39893FA5F65CAE1
10 changed files with 383 additions and 389 deletions

View file

@ -5,17 +5,16 @@
let
inherit (pkgs) lib;
makePostgresqlWal2jsonTest =
postgresqlPackage:
makeTestFor = package:
makeTest {
name = "wal2json-${postgresqlPackage.name}";
name = "wal2json-${package.name}";
meta.maintainers = with pkgs.lib.maintainers; [ euank ];
nodes.machine = {
services.postgresql = {
package = postgresqlPackage;
inherit package;
enable = true;
extraPlugins = with postgresqlPackage.pkgs; [ wal2json ];
extraPlugins = with package.pkgs; [ wal2json ];
settings = {
wal_level = "logical";
max_replication_slots = "10";
@ -40,11 +39,10 @@ let
)
'';
};
in
lib.recurseIntoAttrs (
lib.concatMapAttrs (n: p: { ${n} = makePostgresqlWal2jsonTest p; }) pkgs.postgresqlVersions
lib.concatMapAttrs (n: p: { ${n} = makeTestFor p; }) (lib.filterAttrs (_: p: !p.pkgs.wal2json.meta.broken) pkgs.postgresqlVersions)
// {
passthru.override = p: makePostgresqlWal2jsonTest p;
passthru.override = p: makeTestFor p;
}
)