PYTHON-5753 Add just recipes for running coverage tests locally (#2727)
This commit is contained in:
parent
3d89d9faca
commit
80c3ff2aee
1
.gitignore
vendored
1
.gitignore
vendored
@ -43,3 +43,4 @@ test/lambda/*.json
|
|||||||
xunit-results/
|
xunit-results/
|
||||||
coverage.xml
|
coverage.xml
|
||||||
server.log
|
server.log
|
||||||
|
.coverage
|
||||||
|
|||||||
@ -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:
|
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`.
|
`just test test/test_change_stream.py::TestUnifiedChangeStreamsErrors::test_change_stream_errors_on_ElectionInProgress`.
|
||||||
- Use the `-k` argument to select tests by pattern.
|
- 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
|
## Running tests that require secrets, services, or other configuration
|
||||||
|
|||||||
19
justfile
19
justfile
@ -82,6 +82,25 @@ teardown-tests:
|
|||||||
integration-tests:
|
integration-tests:
|
||||||
bash integration_tests/run.sh
|
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')]
|
[group('server')]
|
||||||
run-server *args="":
|
run-server *args="":
|
||||||
bash .evergreen/scripts/run-server.sh {{args}}
|
bash .evergreen/scripts/run-server.sh {{args}}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user