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

View File

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