PYTHON-5753 Add just recipes for running coverage tests locally (#2727)

This commit is contained in:
Jeffrey 'Alex' Clark 2026-03-12 12:42:15 -04:00 committed by GitHub
parent 3d89d9faca
commit 80c3ff2aee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 21 additions and 0 deletions

1
.gitignore vendored
View File

@ -43,3 +43,4 @@ test/lambda/*.json
xunit-results/
coverage.xml
server.log
.coverage

View File

@ -205,6 +205,7 @@ the pages will re-render and the browser will automatically refresh.
and the `<class_name>` to test a full module. For example:
`just test test/test_change_stream.py::TestUnifiedChangeStreamsErrors::test_change_stream_errors_on_ElectionInProgress`.
- Use the `-k` argument to select tests by pattern.
- Run `just test-coverage` to run tests with coverage and display a report. After running tests with coverage, use `just coverage-html` to generate an HTML report in `htmlcov/index.html`.
## Running tests that require secrets, services, or other configuration

View File

@ -82,6 +82,25 @@ teardown-tests:
integration-tests:
bash integration_tests/run.sh
[group('test')]
test-coverage *args="":
just setup-tests --cov
just run-tests {{args}}
[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}}