Skip to content
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

chore: fix coverage warning when re-running failed tests in CI #473

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,21 @@ pytest_no_flaky: check_current_flaky_tests

# Runnning latest failed tests works by accessing pytest's cache. It is therefore recommended to
# call '--cache-clear' when calling the previous pytest run.
# --cov PATH is the directory PATH to consider for coverage. Default to SRC_DIR=src
# --cov-append is to make the coverage of the previous pytest run to also consider the tests that are
# going to be re-executed by 'pytest_run_last_failed'
# --global-coverage-infos-json=global-coverage-infos.json is to dump the coverage report in the file
# --last-failed runs all last failed tests
# --last-failed-no-failures none' indicates pytest not to run anything (instead of running
# all tests over again) if no failed tests are found
.PHONY: pytest_run_last_failed # Run all failed tests from the previous pytest run
pytest_run_last_failed:
poetry run pytest $(TEST) --last-failed --last-failed-no-failures none
poetry run pytest $(TEST) \
--cov=$(SRC_DIR) \
--cov-append \
--global-coverage-infos-json=global-coverage-infos.json \
--last-failed \
--last-failed-no-failures none

.PHONY: pytest_one # Run pytest on a single file or directory (TEST)
pytest_one:
Expand Down
Loading