2 system ? builtins.currentSystem,
4 pkgs ? import ../.. { inherit system config; },
9 makeTest = import ./make-test-python.nix;
10 # Makes a test for a PostgreSQL package, given by name and looked up from `pkgs`.
11 makeTestAttribute = name: {
13 value = makePostgresqlWal2jsonTest pkgs."${name}";
16 makePostgresqlWal2jsonTest =
19 name = "postgresql-wal2json-${postgresqlPackage.name}";
20 meta.maintainers = with pkgs.lib.maintainers; [ euank ];
23 services.postgresql = {
24 package = postgresqlPackage;
26 extraPlugins = with postgresqlPackage.pkgs; [ wal2json ];
28 wal_level = "logical";
29 max_replication_slots = "10";
30 max_wal_senders = "10";
36 machine.wait_for_unit("postgresql")
38 "sudo -u postgres psql -qAt -f ${./postgresql/wal2json/example2.sql} postgres > /tmp/example2.out"
41 "diff ${./postgresql/wal2json/example2.out} /tmp/example2.out"
44 "sudo -u postgres psql -qAt -f ${./postgresql/wal2json/example3.sql} postgres > /tmp/example3.out"
47 "diff ${./postgresql/wal2json/example3.out} /tmp/example3.out"
53 # By default, create one test per postgresql version
54 if postgresql == null then
55 builtins.listToAttrs (
56 map makeTestAttribute (builtins.attrNames (import ../../pkgs/servers/sql/postgresql pkgs))
58 # but if postgresql is set, we're being made as a passthru test for a specific postgres + wal2json version, just run one
60 makePostgresqlWal2jsonTest postgresql