mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-16 17:14:00 +00:00
postgresqlPackages.timescaledb: make passthru.tests work with correct package
Same reasoning as commit before.
This commit is contained in:
parent
6d7da20a90
commit
23c19a255f
@ -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;
|
||||
}
|
||||
|
@ -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";
|
||||
|
@ -25,9 +25,7 @@
|
||||
|
||||
passthru = {
|
||||
updateScript = nix-update-script { };
|
||||
tests = {
|
||||
timescaledb_toolkit = nixosTests.timescaledb;
|
||||
};
|
||||
tests = nixosTests.timescaledb.passthru.override postgresql;
|
||||
};
|
||||
|
||||
# tests take really long
|
||||
|
Loading…
Reference in New Issue
Block a user