clan-cli/tests: limit jobs to 16

This reduces overload on the CI, as it already runs multiple test instances in parallel (with-core, without-core, etc), and otherwise would spawn 96 workers for each of those.
This commit is contained in:
DavHau
2025-03-09 14:02:34 +07:00
committed by Luis Hebendanz
parent 9e994f87d5
commit af66b63286

View File

@@ -142,7 +142,10 @@ pythonRuntime.pkgs.buildPythonApplication {
export LOCK_NIX=$TMPDIR/nix_lock
mkdir -p "$CLAN_TEST_STORE/nix/store"
python -m pytest -m "not impure and not with_core" ./tests
# limit build cores to 16
jobs="$((NIX_BUILD_CORES>16 ? 16 : NIX_BUILD_CORES))"
python -m pytest -m "not impure and not with_core" -n $jobs ./tests
touch $out
'';
clan-pytest-with-core =
@@ -181,7 +184,11 @@ pythonRuntime.pkgs.buildPythonApplication {
mkdir -p "$CLAN_TEST_STORE/nix/var/nix/gcroots"
xargs cp --recursive --target "$CLAN_TEST_STORE/nix/store" < "$closureInfo/store-paths"
nix-store --load-db --store "$CLAN_TEST_STORE" < "$closureInfo/registration"
python -m pytest -m "not impure and with_core" ./tests
# limit build cores to 16
jobs="$((NIX_BUILD_CORES>16 ? 16 : NIX_BUILD_CORES))"
python -m pytest -m "not impure and with_core" ./tests -n $jobs
touch $out
'';
};