Skip to content

Setup coverage (windows)#249

Merged
gvanrossum merged 2 commits intomicrosoft:mainfrom
bmerkle:setup-coverage
Apr 24, 2026
Merged

Setup coverage (windows)#249
gvanrossum merged 2 commits intomicrosoft:mainfrom
bmerkle:setup-coverage

Conversation

@bmerkle
Copy link
Copy Markdown
Collaborator

@bmerkle bmerkle commented Apr 24, 2026

This PR:
fixed setup for uv coverage under Windows

Copilot AI review requested due to automatic review settings April 24, 2026 15:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 coverage command to make.bat that runs coverage.py via uv run.
  • Updated .coveragerc to measure coverage from src instead of test.

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.

Comment thread make.bat
Comment on lines +50 to +53
uv run coverage erase
uv run coverage run -m pytest
uv run coverage combine
uv run coverage report
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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="

Copilot uses AI. Check for mistakes.
@gvanrossum gvanrossum merged commit 016d614 into microsoft:main Apr 24, 2026
20 checks passed
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.

3 participants