run-tests
БесплатноБез исполняемых скриптовНе проверенValidate code changes by intelligently selecting and running the appropriate test suites. Use this when editing code to verify changes work correctly, run…
Об этом скилле
Test Suite Validation Skill
This skill helps you efficiently validate code changes by running the appropriate subset of the test suite. It uses scripts/run-tests to intelligently discover affected tests and run only what's necessary for validation.
When to Use This Skill
Use this skill when you have:
- Made changes to source code files and want to validate they work
- Fixed a bug and want to verify the fix
- Added a feature and need test coverage
- Modified test infrastructure or configuration
- Want to verify changes don't break existing functionality
Key Principles
- Always use the run-tests skill when testing code changes - it's optimized for intelligent suite discovery
- Never run pytest directly - bypasses the project's test infrastructure (use
scripts/run-testsorriotviascripts/ddtest) - Minimal venvs for iteration - run 1-2 venvs initially, expand only if needed
- Use
--dry-runfirst - see what would run before executing - Follow official docs -
docs/contributing-testing.rstis the source of truth for testing procedures
How This Skill Works
Step 1: Identify Changed Files
First, determine which files were modified:
- If you have pending edits, I'll identify the changed files from the current session
- I'll look at git status to find staged, unstaged, and untracked changes
- You can also specify files explicitly if working on specific changes
Step 2: Discover Available Test Suites
I'll use the scripts/run-tests script to discover what test suites match your changes:
scripts/run-tests --list <edited-files>
This outputs JSON showing:
- Available test suites that match your changed files
- All venvs (Python versions + package combinations) available for each suite
- Their hashes, Python versions, and package versions
Step 3: Intelligently Select Venvs
Rather than running ALL available venvs (which could take hours), I'll select the minimal set needed to validate your changes:
For Core/Tracing Changes (Broad Impact)
When you modify files like:
ddtrace/internal/core/*,ddtrace/_trace/*,ddtrace/trace/*ddtrace/_monkey.py,ddtrace/settings/*ddtrace/constants.py
Strategy: Run core tracer + internal tests with 1 venv each
- Example:
tracersuite with latest Python +internalsuite with latest Python - This validates broad-reaching changes without excessive overhead
- Skip integration suites unless the change directly affects integration code
For Integration/Contrib Changes (Targeted Impact)
When you modify files like:
ddtrace/contrib/flask/*,ddtrace/contrib/django/*, etc.ddtrace/contrib/*/patch.pyor integration-specific code
Strategy: Run ONLY the affected integration suite with 1-2 venvs
- Example: Flask changes → run
contrib::flasksuite with latest Python - If change involves multiple versions (e.g., Django 3.x and 4.x), pick 1 venv per major version
- Skip unrelated integrations
For Test-Only Changes
When you modify tests/ files (but not test infrastructure):
- Run only the specific test files/functions modified
- Use pytest args:
-- -k test_nameor direct test file paths
For Test Infrastructure Changes
When you modify:
tests/conftest.py,tests/suitespec.yml,scripts/run-tests,riotfile.py
Strategy: Run a quick smoke test suite
- Example:
internalsuite with 1 venv as a sanity check - Or run small existing test suites to verify harness changes
Step 4: Execute Selected Venvs
I'll run the selected venvs using:
scripts/run-tests --venv <hash1> --venv <hash2> ...
This will:
- Start required Docker services (redis, postgres, etc.)
- Run tests in the specified venvs sequentially
- Stop services after completion
- Show real-time output and status
Step 5: Handle Results
If tests pass: ✅ Your changes are validated!
If tests fail: 🔴 I'll:
- Show you the failure details
- Identify which venv failed
- Ask clarifying questions to understand the issue
- Offer to run specific failing tests with more verbosity
- Help iterate on fixes and re-run
For re-running specific tests:
scripts/run-tests --venv <hash> -- -vv -k test_name
When Tests Fail
When you encounter test failures, follow this systematic approach:
- Review the failure details carefully - Don't just skim the error, understand what's actually failing
- Understand what's failing - Don't blindly re-run; analyze the root cause
- Make code changes - Fix the underlying issue
- Re-run with more verbosity if needed - Use
-vvor-vvvfor detailed output - Iterate until tests pass - Repeat the process with each fix
Venv Selection Strategy in Detail
Understanding Venv Hashes
From scripts/run-tests --list, you'll see output like:
{
"suites": [
{
"name": "tracer",
"venvs": [
{
"hash": "abc123",
"python_version": "3.8",
"packa
Установить run-tests в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashReadGrepGlobTodoWriteВложенные файлы
FAQ
Что делает скилл run-tests?
Validate code changes by intelligently selecting and running the appropriate test suites. Use this when editing code to verify changes work correctly, run tests, validate functionality, or check for regressions. Automatically discovers affected test suites, selects the minimal set of venvs needed for validation, and handles test execution with Docker services as needed.
Как установить скилл run-tests?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл run-tests запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic