Skip to content

perf(ci): lower the coverage floor to 85% and fail a pull request below 90% on its changed lines - #2375

Merged
dan-petty merged 3 commits into
mainfrom
perf/2356-coverage-floor-and-test-cost
Oct 27, 2026
Merged

dan-petty merged 3 commits into
mainfrom
perf/2356-coverage-floor-and-test-cost

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

What

  • fail_under in pyproject.toml is 85. It was 90.
  • The Changed-Line Coverage step of ci.yml fails the job when under 90% of the changed lines of a pull request are covered. It still lists the added pragma: no cover lines in the job summary, then exits with the status of diff-cover. A pull request that changes no line of src/ has no figure and passes.
  • CONTRIBUTING.md and docs/TESTING.md give the two figures. The other documents name the gates without a figure. A test holds the two figures to fail_under.
  • No test is removed.

Why

The owner decided on 2026-10-27 (#2356) that the floor goes down to 85% and that the changed lines are gated. A floor alone lets untested code in. A gate on the changed lines keeps the pressure on the code that a pull request changes.

The issue also asks to remove the slowest tests of least value. The measurement (design.md of the archived change) shows that this does not pay:

  • 83% of the test time (2,007 of 2,423 s) is in tests that may not be removed: invariants, ratchets, contract suites, security tests, and files that an OpenSpec change cites.
  • All 2,634 tests that may be removed sum to 416 s. That is 26 s on 16 workers, and removing all of them puts the line coverage at 84.96%.
  • Their seconds are mostly the first import of each worker. The 184 best candidates take 192 s in the run and 61 s one after the other in one process.

The causes go to sub-issues: #2369 (the startup-import tests), #2371 (what each worker repeats at start) and #2373 (what coverage and branch measurement cost). Branch coverage is 90.75% with lines and branches, and 93.01% with lines only.

Part of #2356. This pull request does not close #2356: its acceptance (the median of Tests & Coverage at or under 240 s) depends on the sub-issues.

…ow 90% on its changed lines

The owner decided on 2026-10-27 that the floor of the whole tree goes down to 85% and
that the changed lines of a pull request are gated (#2356).

- fail_under in pyproject.toml is 85.
- The Changed-Line Coverage step of ci.yml runs diff-cover with --fail-under 90. It still
  writes the added pragma lines to the job summary when it fails, then exits with the
  status of diff-cover.
- CONTRIBUTING.md and docs/TESTING.md give the figures. The other documents name the
  gates without a figure, and a test holds the two figures to pyproject.toml.
- No test is removed. design.md holds the measurement: 83% of the test time is in tests
  that may not be removed, and the seconds of the rest are mostly the first import of
  each worker.
@dan-petty

Copy link
Copy Markdown
Owner Author

Verification record.

Checks run before the push

  • Full local gate uv run devops ci: 19 of 19 checks pass. The test row took 7 m 15 s because other agents loaded the host (load average 13 to 19) during the run. The warning "Tests took 7m 15s, over the 5m budget" comes from that load, not from this change: the same suite took 287 s of pytest time on an idle host.
  • The workflow test failed first (index 5, the missing --fail-under 90), then passed after the step changed.
  • The real run block of the step, in a scratch repository: a change with no source line exits 0 ("No lines with coverage information"); 10 of 10 changed lines covered exits 0; 5 of 10 covered exits 1 ("src/devops_cli/m.py (50.0%): Missing lines 16-20"), and the summary still holds the pragma section.

What was not done, and why

  • devops ci mutate was not run. No test is removed, so there is nothing to check, and its own help says the first run executes the whole suite serially and "can take hours".
  • The cost of coverage and of branch measurement is not stated. Three comparison runs on a host with a load average of 10 to 39 could not separate it from the noise, and two of them measured nothing (0.00% coverage), so I dropped them. perf(ci): measure coverage and branch cost #2373 measures it on an idle host.
  • No test is removed. The numbers are in design.md of the archived change.

Notes for the reviewer

@dan-petty
dan-petty marked this pull request as ready for review October 27, 2026 19:36
@dan-petty
dan-petty merged commit 9f97c14 into main Oct 27, 2026
16 checks passed
@dan-petty
dan-petty deleted the perf/2356-coverage-floor-and-test-cost branch October 27, 2026 19:38
dan-petty pushed a commit that referenced this pull request Oct 27, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.7.4](v0.7.3...v0.7.4)
(2026-10-27)


### Bug Fixes

* **ai:** chat calls stream their reply, and the gateway keeps the
stream open past the 125 s edge timeout
([#2379](#2379))
([0abf552](0abf552)),
closes [#2365](#2365)
* **ai:** the devops ai failover help says that the gateway failover
records a route, not that it reroutes requests
([#2376](#2376))
([6560b93](6560b93)),
closes [#2079](#2079)
* **docs:** add home page, remove raw markdown publishing, and check
links ([#2070](#2070))
([#2372](#2372))
([7f9321c](7f9321c))
* **llm:** pass num_ctx with direct ollama embedding requests
([#2378](#2378))
([ff47504](ff47504)),
closes [#2089](#2089)
* **roadmap:** intake's reply schema limits each fixed field to its
values, so the model cannot leave type empty
([#2380](#2380))
([b9220b1](b9220b1)),
closes [#2370](#2370)
* **telemetry:** a gateway inference span names the deployment model
that served the call as gen_ai.response.model
([#2381](#2381))
([78dbd1d](78dbd1d))


### Performance Improvements

* **ci:** lower the coverage floor to 85% and fail a pull request below
90% on its changed lines
([#2375](#2375))
([9f97c14](9f97c14))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(test): lower the coverage floor to 85%, remove the slowest tests of least value and find further test speed-ups

1 participant