consolidate clan-lib/clan-cli pytest into one test derivation
Than we can re-use test pytest worker better and it's less complex.
This commit is contained in:
@@ -195,48 +195,6 @@ pythonRuntime.pkgs.buildPythonApplication {
|
|||||||
pkgs.coreutils
|
pkgs.coreutils
|
||||||
pkgs.nix
|
pkgs.nix
|
||||||
];
|
];
|
||||||
closureInfo = pkgs.closureInfo {
|
|
||||||
rootPaths = [
|
|
||||||
templateDerivation
|
|
||||||
pkgs.bash
|
|
||||||
pkgs.coreutils
|
|
||||||
pkgs.jq.dev
|
|
||||||
pkgs.stdenv
|
|
||||||
pkgs.stdenvNoCC
|
|
||||||
pkgs.shellcheck-minimal
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
''
|
|
||||||
set -euo pipefail
|
|
||||||
cp -r ${sourceWithTests} ./src
|
|
||||||
chmod +w -R ./src
|
|
||||||
cd ./src
|
|
||||||
|
|
||||||
${setupNixInNix}
|
|
||||||
|
|
||||||
export CLAN_CORE_PATH=${clan-core-path}
|
|
||||||
export PYTHONWARNINGS=error
|
|
||||||
|
|
||||||
# limit build cores to 16
|
|
||||||
jobs="$((NIX_BUILD_CORES>16 ? 16 : NIX_BUILD_CORES))"
|
|
||||||
|
|
||||||
python -m pytest -m "not impure and with_core" ./clan_cli -n $jobs
|
|
||||||
touch $out
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
// lib.optionalAttrs (!stdenv.isDarwin) {
|
|
||||||
# disabled on macOS until we fix all remaining issues
|
|
||||||
clan-lib-pytest =
|
|
||||||
runCommand "clan-lib-pytest"
|
|
||||||
{
|
|
||||||
nativeBuildInputs = testDependencies;
|
|
||||||
buildInputs = [
|
|
||||||
pkgs.bash
|
|
||||||
pkgs.coreutils
|
|
||||||
pkgs.nix
|
|
||||||
|
|
||||||
];
|
|
||||||
closureInfo = pkgs.closureInfo {
|
closureInfo = pkgs.closureInfo {
|
||||||
rootPaths = [
|
rootPaths = [
|
||||||
templateDerivation
|
templateDerivation
|
||||||
@@ -268,10 +226,11 @@ pythonRuntime.pkgs.buildPythonApplication {
|
|||||||
export NIXPKGS=${nixpkgs}
|
export NIXPKGS=${nixpkgs}
|
||||||
export NIX_SELECT=${nix-select}
|
export NIX_SELECT=${nix-select}
|
||||||
|
|
||||||
# limit build cores to 4
|
# limit build cores to 16
|
||||||
jobs="$((NIX_BUILD_CORES>4 ? 4 : NIX_BUILD_CORES))"
|
jobs="$((NIX_BUILD_CORES>16 ? 16 : NIX_BUILD_CORES))"
|
||||||
|
|
||||||
python -m pytest -m "with_core" ./clan_lib -n $jobs
|
# Run all tests with core marker
|
||||||
|
python -m pytest -m "not impure and with_core" -n $jobs ./clan_cli ./clan_lib
|
||||||
touch $out
|
touch $out
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user