postgresqlPackages.timescaledb: make passthru.tests work with correct package

Same reasoning as commit before.
This commit is contained in:
Wolfgang Walther 2024-11-01 20:48:25 +01:00
parent 6d7da20a90
commit 23c19a255f
No known key found for this signature in database
GPG Key ID: B39893FA5F65CAE1
3 changed files with 12 additions and 18 deletions

View File

@ -1,6 +1,3 @@
# mostly copied from ./postgresql.nix as it seemed unapproriate to
# test additional extensions for postgresql there.
{ system ? builtins.currentSystem
, config ? { }
, pkgs ? import ../.. { inherit system config; }
@ -10,7 +7,6 @@ with import ../lib/testing-python.nix { inherit system pkgs; };
with pkgs.lib;
let
postgresql-versions = import ../../pkgs/servers/sql/postgresql pkgs;
test-sql = pkgs.writeText "postgresql-test" ''
CREATE EXTENSION timescaledb;
CREATE EXTENSION timescaledb_toolkit;
@ -40,9 +36,12 @@ let
SELECT
average(stats)
FROM t;
SELECT * FROM sth;
'';
make-postgresql-test = postgresql-name: postgresql-package: makeTest {
name = postgresql-name;
makeTimescaleDbTest = postgresqlPackage: makeTest {
name = "timescaledb-${postgresqlPackage.name}";
meta = with pkgs.lib.maintainers; {
maintainers = [ typetetris ];
};
@ -51,7 +50,7 @@ let
{
services.postgresql = {
enable = true;
package = postgresql-package;
package = postgresqlPackage;
extraPlugins = ps: with ps; [
timescaledb
timescaledb_toolkit
@ -83,11 +82,8 @@ let
'';
};
applicablePostgresqlVersions = filterAttrs (_: value: versionAtLeast value.version "14") postgresql-versions;
in
mapAttrs'
(name: package: {
inherit name;
value = make-postgresql-test name package;
})
applicablePostgresqlVersions
pkgs.lib.concatMapAttrs (n: p: { ${n} = makeTimescaleDbTest p; }) (filterAttrs (n: p: !p.pkgs.timescaledb.meta.broken) pkgs.postgresqlVersions)
// {
passthru.override = p: makeTimescaleDbTest p;
}

View File

@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
done
'';
passthru.tests = { inherit (nixosTests) timescaledb; };
passthru.tests = nixosTests.timescaledb.passthru.override postgresql;
meta = with lib; {
description = "Scales PostgreSQL for time-series data via automatic partitioning across time and space";

View File

@ -25,9 +25,7 @@
passthru = {
updateScript = nix-update-script { };
tests = {
timescaledb_toolkit = nixosTests.timescaledb;
};
tests = nixosTests.timescaledb.passthru.override postgresql;
};
# tests take really long