nixosTests.postgresql-jit: avoid manual imports

Same reasoning as commit before.
This commit is contained in:
Wolfgang Walther 2024-11-01 19:27:43 +01:00
parent a1ae4377e0
commit 65ef7381c8
No known key found for this signature in database
GPG Key ID: B39893FA5F65CAE1
2 changed files with 6 additions and 15 deletions

View File

@ -1,20 +1,15 @@
{ system ? builtins.currentSystem
, config ? {}
, pkgs ? import ../.. { inherit system config; }
, package ? null
}:
with import ../lib/testing-python.nix { inherit system pkgs; };
let
inherit (pkgs) lib;
packages = builtins.attrNames (import ../../pkgs/servers/sql/postgresql pkgs);
mkJitTestFromName = name:
mkJitTest pkgs.${name};
mkJitTest = package: makeTest {
name = package.name;
name = "postgresql-jit-${package.name}";
meta.maintainers = with lib.maintainers; [ ma27 ];
nodes.machine = { pkgs, lib, ... }: {
services.postgresql = {
@ -49,7 +44,7 @@ let
'';
};
in
if package == null then
lib.genAttrs packages mkJitTestFromName
else
mkJitTest package
lib.concatMapAttrs (n: p: { ${n} = mkJitTest p; }) (lib.filterAttrs (n: _: lib.hasSuffix "_jit" n) pkgs.postgresqlVersions)
// {
passthru.override = p: mkJitTest p;
}

View File

@ -315,11 +315,7 @@ let
postgresql-wal-receiver = nixosTests.postgresql-wal-receiver.passthru.override finalAttrs.finalPackage;
pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
} // lib.optionalAttrs jitSupport {
postgresql-jit = import ../../../../nixos/tests/postgresql-jit.nix {
inherit (stdenv) system;
pkgs = self;
package = this;
};
postgresql-jit = nixosTests.postgresql-jit.passthru.override finalAttrs.finalPackage;
};
};