mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50: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
|
@ -1,4 +1,4 @@
|
|||
{ stdenv, lib, fetchFromGitHub, postgresql, boost182, nixosTests }:
|
||||
{ stdenv, lib, fetchFromGitHub, postgresql, boost182, postgresqlTestExtension }:
|
||||
|
||||
let
|
||||
version = "1.7.0";
|
||||
|
@ -20,7 +20,7 @@ let
|
|||
};
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "apache_datasketches";
|
||||
inherit version;
|
||||
|
||||
|
@ -61,7 +61,13 @@ stdenv.mkDerivation {
|
|||
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 = {
|
||||
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;
|
||||
maintainers = with lib.maintainers; [ mmusnjak ];
|
||||
};
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue