% of PRs Merged with Tests
Last updated: October 27, 2026
% of PRs merged with tests is the share of merged pull requests (PRs) that added or changed at least one line in a test file. It shows testing discipline in your day-to-day changes. It isn't code coverage.
Why it matters
Early warning: a falling share can signal rising defect risk before bugs show up.
Team comparison: shows where testing practices differ across teams and repositories.
Quality context: paired with PR Revert Rate and % of PRs Merged Without Review, it highlights the riskiest changes: unreviewed and untested.
It's a positive metric: higher is better.
How it works
% of PRs merged with tests = merged PRs with tests ÷ eligible merged PRs × 100
An admin enters test file patterns in gitignore syntax.
When Span processes a PR's diff, it tags each file that matches a test pattern and adds up that file's added, modified, and removed lines.
A PR counts as "with tests" when it adds or modifies at least one line in a test file. A PR that only deletes test lines doesn't count.
Numerator: merged PRs with tests by people marked Contributor. Denominator: all merged PRs by people marked Contributor. Both leave out repositories you've excluded from this metric.
Where to find it: Insights > Productivity > Velocity > Delivery, on the % of PRs merged with tests card, with a trend chart and percentile rank. Filter by team, person, repository, or time period. It's also in Targets (PRs with Tests), the PR Has Tests filter on PR reports, and team and person Metrics tabs. Supporting counts: Total PRs merged with tests and the eligible merged PRs.
Setup
Go to Settings > Metrics and find % PRs With Tests Metric. You need the Metrics Configuration permission (Owners and Admins by default).
Enter your test file patterns in gitignore syntax, up to 5,000 characters. Until at least one pattern is set, the metric and its target stay hidden.
Optionally, under Ignore Repositories for PRs-With-Tests Metric, list repositories that never carry tests, such as docs, infrastructure, or config repositories. They leave both sides of the calculation.
Optionally, add a PRs with Tests target in Targets to list merged PRs without tests for your team.
Pattern type | Example | Matches |
|---|---|---|
Wildcards |
| Files ending with these patterns |
Directories |
| Entire directories |
Nested paths |
| Test directories at any depth |
Globs |
| Files at any directory depth |
Exclusions |
| Excludes a file ( |
Common patterns: JavaScript and TypeScript *.spec.ts, *.test.js, __tests__/; Python test_*.py, *_test.py, tests/; Java *Test.java, src/test/**; Ruby *_spec.rb, spec/; Go *_test.go.
Things to know
The Low rate of PRs with tests signal uses percentage points. Span compares a team's share over the most recent 2 weeks with its share over the 8 weeks before that. When the recent share is 20 percentage points or more lower, a signal appears on the team overview in Span and in the daily brief. Worked example: a team's 8-week share is 78%. If the last 2 weeks come in at 65%, the drop is 13 points and no signal appears. At 55%, the drop is 23 points and the signal appears.
Test files count even if you ignore them for line counts. A test file that also matches PR Lines of Code Metrics: Ignore Files still counts as a test here.
It checks presence, not quality. It doesn't measure coverage, whether tests pass, or whether the tests are meaningful.
Pattern gaps undercount. Tests in folders your patterns miss don't count. Check your patterns against your repository layout.
Excluded repositories raise the share. Repos you exclude leave the denominator, so the share is higher than it would be across all PRs.
Some PRs legitimately skip tests. Docs, dependency updates, config changes, pure refactors, and emergency hotfixes often have no test changes. Set targets with your mix of PR types in mind.
Reverted PRs leave both sides. PRs merged on out-of-office days count.
Related articles
% of PRs Merged Without Review
Need help?
Contact your Span account team or reach out to support@span.app.