From 72698b35cec5ef8c00dd049df7970db4b43cadd1 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Sun, 1 May 2022 10:19:26 -0400 Subject: [PATCH 1/4] duckdb: run unit tests --- pkgs/development/libraries/duckdb/default.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkgs/development/libraries/duckdb/default.nix b/pkgs/development/libraries/duckdb/default.nix index d8cae867f4f2..2041a14bfcc5 100644 --- a/pkgs/development/libraries/duckdb/default.nix +++ b/pkgs/development/libraries/duckdb/default.nix @@ -47,6 +47,22 @@ stdenv.mkDerivation rec { "-DJDBC_DRIVER=${enableFeature withJdbc}" ]; + doInstallCheck = true; + + installCheckPhase = '' + runHook preInstallCheck + + $PWD/test/unittest \ + 'exclude:[test_slow]' \ + 'exclude:*test_slow' \ + exclude:test/sql/copy/csv/test_csv_remote.test \ + exclude:test/sql/copy/parquet/test_parquet_remote.test \ + exclude:test/common/test_cast_hugeint.test \ + exclude:'Test file buffers for reading/writing to file' + + runHook postInstallCheck + ''; + nativeBuildInputs = [ cmake ninja ]; buildInputs = lib.optionals withHttpFs [ openssl ] ++ lib.optionals withJdbc [ openjdk11 ] From 2b88803ac9d442e8de92950228e9f23c0adc51d2 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Sun, 1 May 2022 12:16:08 -0400 Subject: [PATCH 2/4] duckdb: skip kurtosis and skewness tests on aarch64 --- pkgs/development/libraries/duckdb/default.nix | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/pkgs/development/libraries/duckdb/default.nix b/pkgs/development/libraries/duckdb/default.nix index 2041a14bfcc5..ffec2e9ea35a 100644 --- a/pkgs/development/libraries/duckdb/default.nix +++ b/pkgs/development/libraries/duckdb/default.nix @@ -49,19 +49,28 @@ stdenv.mkDerivation rec { doInstallCheck = true; - installCheckPhase = '' - runHook preInstallCheck + installCheckPhase = + let + excludes = map (pattern: "exclude:'${pattern}'") [ + "*test_slow" + "Test file buffers for reading/writing to file" + "[test_slow]" + "test/common/test_cast_hugeint.test" + "test/sql/copy/csv/test_csv_remote.test" + "test/sql/copy/parquet/test_parquet_remote.test" + ] ++ lib.optionals stdenv.isAarch64 [ + "test/sql/aggregate/aggregates/test_kurtosis.test" + "test/sql/aggregate/aggregates/test_skewness.test" + "test/sql/function/list/aggregates/skewness.test" + ]; + in + '' + runHook preInstallCheck - $PWD/test/unittest \ - 'exclude:[test_slow]' \ - 'exclude:*test_slow' \ - exclude:test/sql/copy/csv/test_csv_remote.test \ - exclude:test/sql/copy/parquet/test_parquet_remote.test \ - exclude:test/common/test_cast_hugeint.test \ - exclude:'Test file buffers for reading/writing to file' + $PWD/test/unittest ${toString excludes} - runHook postInstallCheck - ''; + runHook postInstallCheck + ''; nativeBuildInputs = [ cmake ninja ]; buildInputs = lib.optionals withHttpFs [ openssl ] From c05e64b281fabb2099537100a46291b14436df50 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Mon, 2 May 2022 06:44:57 -0400 Subject: [PATCH 3/4] duckdb: add darwin library path to allow tests to run --- pkgs/development/libraries/duckdb/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/libraries/duckdb/default.nix b/pkgs/development/libraries/duckdb/default.nix index ffec2e9ea35a..1969385cd02c 100644 --- a/pkgs/development/libraries/duckdb/default.nix +++ b/pkgs/development/libraries/duckdb/default.nix @@ -49,6 +49,10 @@ stdenv.mkDerivation rec { doInstallCheck = true; + preInstallCheck = lib.optionalString stdenv.isDarwin '' + export DYLD_LIBRARY_PATH="$out/lib''${DYLD_LIBRARY_PATH:+:}''${DYLD_LIBRARY_PATH}" + ''; + installCheckPhase = let excludes = map (pattern: "exclude:'${pattern}'") [ From da664a14400bcc97cbd7807f1d8132798b840e94 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Mon, 2 May 2022 06:45:13 -0400 Subject: [PATCH 4/4] duckdb: concat with space separator explicitly --- pkgs/development/libraries/duckdb/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/duckdb/default.nix b/pkgs/development/libraries/duckdb/default.nix index 1969385cd02c..b128ed709452 100644 --- a/pkgs/development/libraries/duckdb/default.nix +++ b/pkgs/development/libraries/duckdb/default.nix @@ -71,7 +71,7 @@ stdenv.mkDerivation rec { '' runHook preInstallCheck - $PWD/test/unittest ${toString excludes} + $PWD/test/unittest ${lib.concatStringsSep " " excludes} runHook postInstallCheck '';