Guidelines for writing tests, especially integration tests with fixtures.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
<!-- Source paths below are repo-root-relative references, not links navigable from this file's directory. -->
<!-- skillsaw-disable content-unlinked-internal-reference -->
# Testing
## Integration Tests
Integration tests live in `tests/test_integration.py` and verify end-to-end
behavior by driving the CLI (`skillsaw lint` / `fix`) against realistic repo
fixtures.
### Drive the CLI through `run_cli`
`run_lint` and the `_run_fix` helpers call `run_cli` from
`tests/cli_runner.py`, which invokes `skillsaw.cli.main()` in-process with
argv, stdout, stderr, env and cwd swapped, and returns a
`subprocess.CompletedProcess` stand-in. Spawning an interpreter per call cost
~160ms — more than half of it importing skillsaw — and dominated the suite.
Prefer `run_cli` for a new integration test.
Reach for a real `subprocess.run` only when the test depends on something a
shared interpreter cannot give it:
- **Import isolation** — the `--no-custom-rules` tests prove a rule file on
disk did or did not get imported. In-process they would execute an
arbitrary rule inside the test worker, and `sys.modules` could mask a
repeat import and make the negative case pass vacuously.
…
The line at the top of this page pins the label git:20260828.2b62c03, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
GET https://markdownregistry.com/api/v1/artifacts/art_5hxyrkyxsbdbhlvu
GET https://markdownregistry.com/api/v1/resolve?ref=stbenjam/skillsaw/.cursor/rules/testing.mdc
GET https://markdownregistry.com/api/v1/blob/2b2164b556f5fd8ae7f22a98b62a22b08bf364d1d69adce39b1eeb44811b324a
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
stbenjam/skillsaw · .agents/skills/skillsaw-issue-solver/SKILL.md · Pick up open GitHub issues from collaborators and create PRs to solve them. Use when triaging and resolving reported…
stbenjam/skillsaw · .agents/skills/skillsaw-issue/SKILL.md · Use when skillsaw reports a likely false positive, misses an edge case, behaves incorrectly, or needs an RFE. Gather a…
stbenjam/skillsaw · .agents/skills/skillsaw-lint/SKILL.md · Use when modifying agentic contextual building blocks like skills (SKILL.md), slash commands, agents, hooks, plugins…
stbenjam/skillsaw · .agents/skills/skillsaw-onboard/SKILL.md · Onboard a repository to skillsaw — run the linter, triage the findings by rule, apply autofixes, manually fix what…
stbenjam/skillsaw · .agents/skills/skillsaw-pr-followup/SKILL.md · Follow up on open PRs in skillsaw — fix failing CI, address reviewer feedback, push updates, and validate backward…
stbenjam/skillsaw · .agents/skills/skillsaw-release-ready/SKILL.md · Audit skillsaw for release readiness — test new rules against real repositories, audit core architectural dimensions…
stbenjam/skillsaw · .agents/skills/skillsaw-release/SKILL.md · Bump the version, generate release notes, and publish a new skillsaw release to PyPI. Use when cutting a new release.
davepoon/buildwithclaude · plugins/cc-best/skills/testing/SKILL.md · Testing strategies and methodologies including TDD, E2E testing, and multi-framework support
live-codes/livecodes · .agents/skills/livecodes/testing/SKILL.md · Write and run automated tests with Jest and Testing Library in the browser. Import code from script editor, use watch…
team-commonly/commonly · fleet-skills/testing/SKILL.md · Testing and code quality context for Jest, React Testing Library, ESLint, and test patterns. Use when writing tests or…