Command Palette

Search for a command to run...

Назад к скиллам
скилл № 03217

Run Tests

Run the repository's canonical pytest command and capture the final summary lines used by CI and automation.

БесплатноБез исполняемых скриптов
CERTCCот CERTCC★ 22 звезды на GitHub

Установить Run Tests в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Skill: Run Tests

There is one local gate, and it is targeted. Every local test gate — a Pull Request's first push, a fix commit, a conflict merge — runs the test set targeted-tests derives from a diff (PAD-18-001, PAD-18-002, PAD-18-015). No local gate runs the whole unit or integration suite: CI runs both on every push, faster than a 2-CPU slot does, and GitHub's required CI gate refuses the merge until that run passes (PAD-18-003, PAD-18-008, ADR-0221). The gate command is in § "The Targeted Gate" below.

Run Command
The gate (every local gate) see § "The Targeted Gate"
One file, while writing it uv run pytest <path> -n 0
The whole suite CI's, not yours. .github/workflows/python-app.yml runs it on every push; a human can run it from docs/developer/how-to/run-tests.md

The shape of every gate command is the same: redirect, capture $? immediately, tail the log, print the code last, then re-raise it. rc=$? must come directly after the redirected command — any other command in between overwrites $?. The trailing (exit $rc) is what makes the whole statement carry pytest's status, so the command is safe to chain or to use as a gate.

timeout -k 30 1800 is the run's wall-clock ceiling. Three outcomes look alike in a short tail; tell them apart by the exit: line and the log:

You see It means
exit: 124 (137 if the -k kill was needed) The run hung and was killed. No test verdict. Report it with the log's last lines; do not re-run to "see if it passes".
exit: 1 and worker 'gwN' crashed while running <test> A worker died. --max-worker-restart=0 (addopts) ends the run here instead of hanging. Read /sys/fs/cgroup/memory.events: a risen oom_kill means the named test is not the cause.
exit: 1 and Failed: Timeout (>Ns) That one test hit its per-test ceiling. The rest of the run still ran and is summarized.
exit: 127 and timeout: command not found No test ran: the host has no timeout (stock macOS). Run the gate in the devcontainer.

See notes/testing-pitfalls.md § "A Dead xdist Worker Hung the Run".

uv run python .agents/skills/shared/run-heavy.py runs the gate in one of this host's heavy-check slots (#5947). Every slot container on the host shares one Docker VM, and each -n auto run sizes itself to its own container without seeing the others, so a few slots cap how many run at once. The wrapper comes before timeout, so time spent waiting is not charged to the run. While every slot is taken it writes one run-heavy: all N heavy-check slots on this host are busy; waiting (...) line, naming the holders, at the top of the log: a slow start with that line is a queue, not a hang. Its exit status is the command's, so the table above holds, plus one row:

You see It means
exit: 75 and run-heavy: gave up after 3600s No test ran: no slot came free within the wrapper's wait limit. Find the holders the wait line names before rerunning.

-n auto runs the selected files on pytest-xdist workers. test/conftest.py sizes auto to the container's cgroup CPU and memory limits (test/support/xdist_workers.py): a worktree slot is capped by SLOT_CPUS and SLOT_MEMORY (start-dev.sh), while nproc reports every host core, and twelve workers in a 2-CPU, 6 GiB slot were OOM-killed mid-run.

A run takes one agent's share, not the whole container. The setting VULTRON_AGENTS_PER_CONTAINER (default 1) divides the limits, and a reserve for the agent's own processes comes off each share. When you were told how many agents share the container, start the gate command with export VULTRON_AGENTS_PER_CONTAINER=<N>;, so the eval'd pytest inherits it. A bare VAR=N logs=... sets a shell variable that pytest never sees (#6797).

Set PYTEST_XDIST_AUTO_NUM_WORKERS to override both. Drop -n auto (or pass -n 0) for a single-file run while writing it, where starting workers costs more than it saves.

The Targeted Gate

Every local test gate is this command. targeted-tests derives the set from a diff, and the set holds only the change's own tests: the test files that import a changed symbol, the mirror test file of each changed module, and each changed test file (PAD-18-002). No directory is selected whole. test/architecture/ and test/metadata/ hold whole-repo rules (ratchets, spec links, docs and skill checks), and they run on CI, which runs every directory in full. A changed test file inside either one is still selected.

logs="/tmp/vultron-$(basename "$(git rev-parse --show-toplevel)")"  # one set per worktree
git fetch origin <base> || { echo "fetch failed — stop and report"; exit 1; }
gate=$(PYTHONPATH= uv run targeted-tests --base origin/<base> --pytest); rc=$?
[ "$rc" -eq 0 ] && { eval "$gate" > "$logs-gate.log" 2>&1; rc=$?; tail -20 "$logs-gate.log"; }; echo "exit: $rc"; (exit $rc)

exit 1, not `fals

Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл Run Tests?

Run the repository's canonical pytest command and capture the final summary lines used by CI and automation.

Как установить скилл Run Tests?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Run Tests запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить Run Tests с