-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-5753 Add just recipes for running coverage tests locally #2727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
a80d0ad
369a209
9e324e1
c925ecd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,6 +82,35 @@ teardown-tests: | |
| integration-tests: | ||
| bash integration_tests/run.sh | ||
|
|
||
| [group('test')] | ||
| test-coverage *args="": | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
| if [ -n "${USE_ACTIVE_VENV:-}" ]; then | ||
| # When USE_ACTIVE_VENV is set, run coverage directly in the active venv | ||
| uv run --active --extra test --group coverage python -m coverage run -m pytest {{args}} | ||
| uv run --active --group coverage python -m coverage report | ||
| else | ||
| # Otherwise use the standard Evergreen workflow | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| just setup-tests --cov | ||
| just run-tests {{args}} | ||
| just coverage-report | ||
This comment was marked as resolved.
Sorry, something went wrong. |
||
| fi | ||
|
|
||
| [group('coverage')] | ||
| coverage-report: | ||
| uv tool run --with "coverage[toml]" coverage report | ||
|
|
||
| [group('coverage')] | ||
| coverage-html: | ||
| uv tool run --with "coverage[toml]" coverage html | ||
| @echo "Coverage report generated in htmlcov/index.html" | ||
|
|
||
| [group('coverage')] | ||
| coverage-xml: | ||
| uv tool run --with "coverage[toml]" coverage xml | ||
| @echo "Coverage report generated in coverage.xml" | ||
|
|
||
| [group('server')] | ||
| run-server *args="": | ||
| bash .evergreen/scripts/run-server.sh {{args}} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does
just coverage-htmlrequirejust test-coverageto be run first? We should make that clear if so.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done