Affected-Test Selection
The planner maps a Git change set to a safe unit and Playwright test plan.
Selection Pipeline
- Calculate the protected merge base.
- Collect committed, staged, unstaged, renamed, deleted, and configured untracked changes.
- Find owning Rush projects and reverse dependents.
- Ask CodeGraph for statically affected tests.
- Apply explicit mappings and scenario coverage edges.
- Add configured core and smoke safety tests.
- Evaluate fail-open conditions and limits.
- Write a canonical, fingerprinted plan.
Selection Reasons
Each test records why it was included:
changed-testcodegraph-reachablecoversmappingcore-safetysmoke-safety- Project ownership and dependent-project expansion
Use explain for one changed file:
npx playwright-codegraph explain packages/cart/src/quantity.tsPull Request Execution
git fetch origin main
npx playwright-codegraph graph sync
npx playwright-codegraph scenarios
npx playwright-codegraph plan --base origin/main
npx playwright-codegraph runAuthoritative Full Execution
Protected branches, scheduled runs, and releases can create an explicit full plan:
npx playwright-codegraph plan --base HEAD --full
npx playwright-codegraph runThe plan records manual-full-run, inventories every test, and uses each
runner’s configured fullArgs.
Shadow Mode
Shadow mode compares selective execution with an authoritative full run:
npx playwright-codegraph shadow --base origin/mainUse shadow records before making selective execution a required pull request gate. Replay retained records to calculate fallback and missed-failure counts:
npx playwright-codegraph replay --records test-selection-historySafety Guarantee
CodeGraph guarantees deterministic selection for identical inputs and explicit full-suite fallback when evidence is incomplete. It does not claim that applications, browsers, networks, or tests are inherently deterministic.