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:
Jörg Thalheim
2025-06-28 08:52:43 +02:00
parent 784828f966
commit aba15d517f

View File

@@ -195,48 +195,6 @@ pythonRuntime.pkgs.buildPythonApplication {
pkgs.coreutils
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 {
rootPaths = [
templateDerivation
@@ -268,10 +226,11 @@ pythonRuntime.pkgs.buildPythonApplication {
export NIXPKGS=${nixpkgs}
export NIX_SELECT=${nix-select}
# limit build cores to 4
jobs="$((NIX_BUILD_CORES>4 ? 4 : NIX_BUILD_CORES))"
# limit build cores to 16
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
'';
};