-
Notifications
You must be signed in to change notification settings - Fork 635
/
Copy pathtests.nix
41 lines (38 loc) · 1.2 KB
/
tests.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{ pkgs, deps }:
let
inherit (pkgs) stdenv;
in
final: prev: {
ibis-framework = prev.ibis-framework.overrideAttrs (old: {
passthru = old.passthru // {
tests = old.passthru.tests or { } // {
pytest =
let
pythonEnv = final.mkVirtualEnv "ibis-framework-test-env" (deps // {
# Use default dependencies from overlay.nix + enabled tests group.
ibis-framework = deps.ibis-framework or [ ] ++ [ "tests" ];
});
in
stdenv.mkDerivation {
name = "ibis-framework-test";
nativeCheckInputs = [ pythonEnv pkgs.graphviz-nox ];
src = ../.;
doCheck = true;
preCheck = ''
set -euo pipefail
ln -s ${pkgs.ibisTestingData} $PWD/ci/ibis-testing-data
HOME="$(mktemp -d)"
export HOME
'';
checkPhase = ''
runHook preCheck
pytest -m datafusion
pytest -m 'core or duckdb or sqlite or polars' --numprocesses $NIX_BUILD_CORES --dist loadgroup
runHook postCheck
'';
installPhase = "mkdir $out";
};
};
};
});
}