mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
postgresqlPackages.apache_datasketches: move nixosTests.apache_datasketches into package
There is no need to fire up a whole VM just to run a two line test of creating the extension. We can use postgresqlTestExtension for that. This has the advantage that it runs with postgresqlTestHook, so without a VM, making it more portable.
This commit is contained in:
parent
139c546676
commit
aded718a98
3 changed files with 10 additions and 34 deletions
|
@ -815,7 +815,6 @@ in {
|
||||||
postfix-raise-smtpd-tls-security-level = handleTest ./postfix-raise-smtpd-tls-security-level.nix {};
|
postfix-raise-smtpd-tls-security-level = handleTest ./postfix-raise-smtpd-tls-security-level.nix {};
|
||||||
postfixadmin = handleTest ./postfixadmin.nix {};
|
postfixadmin = handleTest ./postfixadmin.nix {};
|
||||||
postgis = handleTest ./postgis.nix {};
|
postgis = handleTest ./postgis.nix {};
|
||||||
apache_datasketches = handleTest ./apache_datasketches.nix {};
|
|
||||||
postgresql = handleTest ./postgresql.nix {};
|
postgresql = handleTest ./postgresql.nix {};
|
||||||
postgresql-jit = handleTest ./postgresql-jit.nix {};
|
postgresql-jit = handleTest ./postgresql-jit.nix {};
|
||||||
postgresql-wal-receiver = handleTest ./postgresql-wal-receiver.nix {};
|
postgresql-wal-receiver = handleTest ./postgresql-wal-receiver.nix {};
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
import ./make-test-python.nix ({ pkgs, ...} : {
|
|
||||||
name = "postgis";
|
|
||||||
meta = with pkgs.lib.maintainers; {
|
|
||||||
maintainers = [ lsix ]; # TODO: Who's the maintener now?
|
|
||||||
};
|
|
||||||
|
|
||||||
nodes = {
|
|
||||||
master =
|
|
||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
services.postgresql = let mypg = pkgs.postgresql_15; in {
|
|
||||||
enable = true;
|
|
||||||
package = mypg;
|
|
||||||
extraPlugins = with mypg.pkgs; [
|
|
||||||
apache_datasketches
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
testScript = ''
|
|
||||||
start_all()
|
|
||||||
master.wait_for_unit("postgresql")
|
|
||||||
master.sleep(10) # Hopefully this is long enough!!
|
|
||||||
master.succeed("sudo -u postgres psql -c 'CREATE EXTENSION datasketches;'")
|
|
||||||
master.succeed("sudo -u postgres psql -c 'SELECT hll_sketch_to_string(hll_sketch_build(1));'")
|
|
||||||
'';
|
|
||||||
})
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv, lib, fetchFromGitHub, postgresql, boost182, nixosTests }:
|
{ stdenv, lib, fetchFromGitHub, postgresql, boost182, postgresqlTestExtension }:
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "1.7.0";
|
version = "1.7.0";
|
||||||
|
@ -20,7 +20,7 @@ let
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
pname = "apache_datasketches";
|
pname = "apache_datasketches";
|
||||||
inherit version;
|
inherit version;
|
||||||
|
|
||||||
|
@ -61,7 +61,13 @@ stdenv.mkDerivation {
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.tests.apache_datasketches = nixosTests.apache_datasketches;
|
passthru.tests.extension = postgresqlTestExtension {
|
||||||
|
inherit (finalAttrs) finalPackage;
|
||||||
|
sql = ''
|
||||||
|
CREATE EXTENSION datasketches;
|
||||||
|
SELECT hll_sketch_to_string(hll_sketch_build(1));
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "PostgreSQL extension providing approximate algorithms for distinct item counts, quantile estimation and frequent items detection";
|
description = "PostgreSQL extension providing approximate algorithms for distinct item counts, quantile estimation and frequent items detection";
|
||||||
|
@ -75,4 +81,4 @@ stdenv.mkDerivation {
|
||||||
license = lib.licenses.asl20;
|
license = lib.licenses.asl20;
|
||||||
maintainers = with lib.maintainers; [ mmusnjak ];
|
maintainers = with lib.maintainers; [ mmusnjak ];
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue