skills_all/run-tests/SKILL.md
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.
npx skillsauth add activer007/ordinary-claude-skills run-testsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
Use this skill when you have:
scripts/run-tests or riot via scripts/ddtest)--dry-run first - see what would run before executingdocs/contributing-testing.rst is the source of truth for testing proceduresFirst, determine which files were modified:
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:
Rather than running ALL available venvs (which could take hours), I'll select the minimal set needed to validate your changes:
When you modify files like:
ddtrace/internal/core/*, ddtrace/_trace/*, ddtrace/trace/*ddtrace/_monkey.py, ddtrace/settings/*ddtrace/constants.pyStrategy: Run core tracer + internal tests with 1 venv each
tracer suite with latest Python + internal suite with latest PythonWhen you modify files like:
ddtrace/contrib/flask/*, ddtrace/contrib/django/*, etc.ddtrace/contrib/*/patch.py or integration-specific codeStrategy: Run ONLY the affected integration suite with 1-2 venvs
contrib::flask suite with latest PythonWhen you modify tests/ files (but not test infrastructure):
-- -k test_name or direct test file pathsWhen you modify:
tests/conftest.py, tests/suitespec.yml, scripts/run-tests, riotfile.pyStrategy: Run a quick smoke test suite
internal suite with 1 venv as a sanity checkI'll run the selected venvs using:
scripts/run-tests --venv <hash1> --venv <hash2> ...
This will:
If tests pass: ✅ Your changes are validated!
If tests fail: 🔴 I'll:
For re-running specific tests:
scripts/run-tests --venv <hash> -- -vv -k test_name
When you encounter test failures, follow this systematic approach:
-vv or -vvv for detailed outputFrom scripts/run-tests --list, you'll see output like:
{
"suites": [
{
"name": "tracer",
"venvs": [
{
"hash": "abc123",
"python_version": "3.8",
"packages": "..."
},
{
"hash": "def456",
"python_version": "3.11",
"packages": "..."
}
]
}
]
}
Latest Python version is your default choice
One venv per suite is usually enough for iteration
Minimize total venvs
Consider test runtime
--venv DirectlyWhen you have a specific venv hash you want to run, you can use it directly without specifying file paths:
scripts/run-tests --venv e06abee
The --venv flag automatically searches all available venvs across all suites, so it works regardless of what files you have locally changed. This is useful when:
Changed file: ddtrace/contrib/internal/flask/patch.py
scripts/run-tests --list ddtrace/contrib/internal/flask/patch.py
# Output shows: contrib::flask suite available
# Select output (latest Python):
# Suite: contrib::flask
# Venv: hash=e06abee, Python 3.13, flask
# Run with --venv directly (searches all venvs automatically)
scripts/run-tests --venv e06abee
# Runs just Flask integration tests
Changed file: ddtrace/_trace/tracer.py
scripts/run-tests --list ddtrace/_trace/tracer.py
# Output shows: tracer suite, internal suite available
# Select strategy:
# - tracer: latest Python (e.g., abc123)
# - internal: latest Python (e.g., def456)
# Run with --venv directly (searches all venvs automatically)
scripts/run-tests --venv abc123 --venv def456
# Validates core tracer and internal components
Changed file: tests/contrib/flask/test_views.py
scripts/run-tests --list tests/contrib/flask/test_views.py
# Output shows: contrib::flask suite
# Run just the specific test:
scripts/run-tests --venv flask_py311 -- -vv tests/contrib/flask/test_views.py
First run shows one test failing:
scripts/run-tests --venv flask_py311 -- -vv -k test_view_called_twice
# Focused on the specific failing test with verbose output
-k filter when re-running failuresgit statusFor comprehensive testing guidance, refer to the contributing documentation:
docs/contributing-testing.rst - Detailed testing guidelines
scripts/run-tests usage examplesdocs/contributing.rst - PR and testing requirements
docs/contributing-design.rst - Test architecture context
When to reference these docs:
contributing-testing.rstcontributing.rstcontributing-design.rst# Manually check/stop services:
docker compose ps
docker compose down
tests/suitespec.yml to understand suite patterns-k to run subset of testsThe scripts/run-tests system:
tests/suitespec.ymlriot to manage multiple Python/package combinations as venvs--Primary suites for validation:
tracer: Core tracing functionality testsinternal: Internal component testscontrib::*: Integration with specific libraries (flask, django, etc.)integration_*: Cross-library integration scenariostelemetry, profiling, appsec, llmobs, etc.Some suites require environment setup:
DD_TRACE_AGENT_URL: For snapshot-based teststools
Generate typed TypeScript SDKs for AI agents to interact with MCP servers. Converts verbose JSON-RPC curl commands to clean function calls (docs.createDocument() vs curl). Auto-detects MCP tools from server modules, generates TypeScript types and client methods, creates runnable example scripts. Use when: building MCP-enabled applications, need typed programmatic access to MCP tools, want Claude Code to manage apps via scripts, eliminating manual JSON-RPC curl commands, validating MCP inputs/outputs, or creating reusable agent automation.
testing
Generate structured task lists from specs or requirements. IMPORTANT: After completing ANY spec via ExitSpecMode, ALWAYS ask the user: "Would you like me to generate a task list for this spec?" Use when user confirms or explicitly requests task generation from a plan/spec/PRD.
tools
Create compelling story-format summaries using UltraThink to find the best narrative framing. Support multiple formats - 3-part narrative, n-length with inline links, abridged 5-line, or comprehensive via Foundry MCP. USE WHEN user says 'create story explanation', 'narrative summary', 'explain as a story', or wants content in Daniel's conversational first-person voice.
testing
Navigate through the original three-world shamanic technology. Deploy when soul retrieval, power animal guidance, or journey between realms emerges. Deeply respectful of Tungus, Buryat, Yakut, Evenki traditions. Use for consciousness navigation, NOT cultural appropriation.