impure-checks: limit number of workers to number of tests

This commit is contained in:
Jörg Thalheim
2025-04-16 14:34:21 +02:00
parent 0b4e896af3
commit ec738fac30

View File

@@ -19,6 +19,7 @@
[ [
pkgs.gitMinimal pkgs.gitMinimal
pkgs.nix pkgs.nix
pkgs.coreutils
pkgs.rsync # needed to have rsync installed on the dummy ssh server pkgs.rsync # needed to have rsync installed on the dummy ssh server
] ]
++ self'.packages.clan-cli-full.runtimeDependencies ++ self'.packages.clan-cli-full.runtimeDependencies
@@ -30,7 +31,12 @@
# this disables dynamic dependency loading in clan-cli # this disables dynamic dependency loading in clan-cli
export CLAN_NO_DYNAMIC_DEPS=1 export CLAN_NO_DYNAMIC_DEPS=1
nix develop "$ROOT#clan-cli" -c bash -c "TMPDIR=/tmp python -m pytest -m impure ./clan_cli $@" jobs=$(nproc)
# Spawning worker in pytest is relatively slow, so we limit the number of jobs to 13
# (current number of impure tests)
jobs="$((jobs > 13 ? 13 : jobs))"
nix develop "$ROOT#clan-cli" -c bash -c "TMPDIR=/tmp python -m pytest -n $jobs -m impure ./clan_cli $@"
''; '';
}; };
} }