pr-test-checker

Grades whether a Positron pull request has adequate test coverage and posts a verdict comment.

4.2k|179|Updated May 24, 2022
One-click install
npx skills add https://github.com/posit-dev/positron --skill pr-test-checker
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pr-test-checker
Source: https://github.com/posit-dev/positron/tree/main/.claude/skills/pr-test-checker
Command: npx skills add https://github.com/posit-dev/positron --skill pr-test-checker

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Reviewing whether a pull request has sufficient test coverage is time-consuming and inconsistent across reviewers. This Skill automates that judgment for the Positron repository by analyzing a PR's diff, classifying changed files, checking existing test coverage, and producing a single graded verdict with concrete, file-specific suggestions.

Core Features & Use Cases

  • Coverage grading: Evaluates new tests in the PR against changed source code and issues one of four verdicts (Adequate, Adequate via existing coverage, Insufficient, Not applicable) with evidence-based justification.
  • Runner-aware analysis: Matches changes to the right test type across Positron's four runners (Vitest, Core Mocha, extension-host Mocha, Playwright e2e) and recommends the cheapest test level that covers the behavior.
  • Deployment surface checks: Detects Windows and web coverage gaps by checking for @:win / @:web e2e tags and browser/ vs electron-sandbox/ parallel implementations.
  • Use Case: A maintainer comments /pete on a PR that adds a new command palette feature; the Skill inspects the diff, finds no test exercising the new command, and posts an Insufficient verdict naming the exact Vitest or e2e test file to add.

Quick Start

Ask the assistant to evaluate whether the current pull request has adequate test coverage and suggest any missing tests.

Frequently Asked Questions about pr-test-checker

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check if my PR has enough test coverage?

Comment /pete on the pull request to trigger the pr-test-checker GitHub Action. It analyzes the diff, classifies changed files, checks existing tests, and posts a verdict comment with specific suggestions for any coverage gaps.

What test framework should I use for new Positron code?

New code under src/vs/ should use Vitest with files at src/vstest*.vitest.ts. Extension code needing an activated extension host uses extension-host Mocha, and full-app user workflows use Playwright e2e tests under test/e2e/.

When does a change need a Playwright e2e test instead of a unit test?

E2e tests are warranted when the behavior needs the full app rendered to verify, such as new providers, modals, command palette entries, or cross-process workflows. Pure logic that can be tested with stubbed services should use cheaper Vitest unit tests instead.

How do I get Windows or web e2e coverage for my PR?

Tag the relevant e2e test with @:win for Windows or @:web for web, since PR-time e2e runs only on Linux/Electron by default. The checker flags hotspot areas like file paths, process spawning, and IPC when these tags are missing.

Can I preview the test coverage verdict locally before opening a PR?

Yes, the gather-local-context.mjs script builds the same context.json from your local working tree using pure git, including uncommitted and untracked files. It produces identical classification and skip decisions to the CI gatherer.

Why was my PR skipped without a coverage grade?

PRs are short-circuited when they are empty, have chore-style title prefixes like chore(deps): or docs:, or touch only docs, config, or lockfiles. These receive a static Not applicable verdict without invoking the LLM grader.