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

feat(tests): add pytest-rerunfailures #3993

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .config/python/dev/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pytablewriter
pytest-cov
pytest-timeout
pytest-xdist
pytest-rerunfailures
python-gitlab
python-gitlab
python-multipart
Expand Down
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
"readdir-scoped-modules",
"rechoir",
"repositoryformatversion",
"rerunfailures",
"reusify",
"rimraf",
"rulesetsoverridetype",
Expand Down
12 changes: 6 additions & 6 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ git config --global --add safe.directory /tmp/lint
# Called by Auto-update CI job
if [ "${UPGRADE_LINTERS_VERSION}" == "true" ]; then
echo "[MegaLinter init] UPGRADING LINTER VERSION"
pip install pytest-cov pytest-timeout
pip install pytest-cov pytest-timeout pytest-rerunfailures
# Run only get_linter_version test methods
pytest -v --durations=0 -k _get_linter_version megalinter/
pytest --reruns 3 --reruns-delay 1 -v --durations=0 -k _get_linter_version megalinter/
# Run only get_linter_help test methods
pytest -v --durations=0 -k _get_linter_help megalinter/
pytest --reruns 3 --reruns-delay 1 -v --durations=0 -k _get_linter_help megalinter/
# Reinstall mkdocs-material because of broken dependency
pip3 install --upgrade markdown mike mkdocs-material pymdown-extensions "mkdocs-glightbox==0.3.2" mdx_truly_sane_lists jsonschema json-schema-for-humans giturlparse webpreview github-dependents-info
cd /tmp/lint || exit 1
Expand All @@ -45,11 +45,11 @@ fi
# Run test cases with pytest
if [ "${TEST_CASE_RUN}" == "true" ]; then
echo "[MegaLinter init] RUNNING TEST CASES"
pip install pytest-cov pytest-timeout pytest-xdist
pip install pytest-cov pytest-timeout pytest-xdist pytest-rerunfailures
if [ -z "${TEST_KEYWORDS}" ]; then
pytest -v --timeout=300 --durations=0 --cov=megalinter --cov-report=xml --numprocesses auto --dist loadscope megalinter/
pytest --reruns 3 --reruns-delay 1 -v --timeout=300 --durations=0 --cov=megalinter --cov-report=xml --numprocesses auto --dist loadscope megalinter/
else
pytest -v --timeout=300 --durations=0 --numprocesses auto --dist loadscope -k "${TEST_KEYWORDS}" megalinter/
pytest --reruns 3 --reruns-delay 1 -v --timeout=300 --durations=0 --numprocesses auto --dist loadscope -k "${TEST_KEYWORDS}" megalinter/
fi
PYTEST_STATUS=$?
echo Pytest exited $PYTEST_STATUS
Expand Down