Setup coverage (windows)#249
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Windows support for running test coverage via uv, aligning the developer workflow with the existing Unix make coverage target.
Changes:
- Added a
coveragecommand tomake.batthat runscoverage.pyviauv run. - Updated
.coveragercto measure coverage fromsrcinstead oftest.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| make.bat | Adds a coverage target and updates the usage string to include it. |
| .coveragerc | Adjusts coverage source configuration to the src tree. |
| uv run coverage erase | ||
| uv run coverage run -m pytest | ||
| uv run coverage combine | ||
| uv run coverage report |
There was a problem hiding this comment.
The Windows coverage target doesn't set COVERAGE_PROCESS_START. Some tests spawn the MCP server in a subprocess and only propagate COVERAGE_PROCESS_START if it’s already present, so coverage for subprocesses won’t be collected on Windows (unlike the Makefile target). Set COVERAGE_PROCESS_START=.coveragerc before coverage run (and optionally unset it afterwards) to match the Unix behavior.
| uv run coverage erase | |
| uv run coverage run -m pytest | |
| uv run coverage combine | |
| uv run coverage report | |
| uv run coverage erase | |
| set "COVERAGE_PROCESS_START=.coveragerc" | |
| uv run coverage run -m pytest | |
| uv run coverage combine | |
| uv run coverage report | |
| set "COVERAGE_PROCESS_START=" |
|
A couple of things I noticed looking at this:
Important This matters even more now that AI agents are writing and modifying tests. They're great at producing code that looks correct — proper structure, reasonable assertions, good names — but they regularly introduce subtle bugs: tests that pass because they assert the wrong thing, helper functions that never get called, branches in test logic that are dead on arrival. The failure mode is silent: CI is green, coverage of
|
|
This PR:
fixed setup for uv coverage under Windows