Skip to content

Commit

Permalink
Work around heisen-failures in CI
Browse files Browse the repository at this point in the history
Use pytest-rerunfailures to rerun flaky test runs

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
  • Loading branch information
pombredanne committed Jan 18, 2023
1 parent 1697461 commit dd15f72
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
24 changes: 12 additions & 12 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
venv/bin/pytest -n 3 -vvs --test-suite=all \
--ignore=tests/cluecode \
--ignore=tests/licensedcode \
--ignore=tests/scancode/test_cli.py
--ignore=tests/scancode/test_cli.py --reruns 2
cluecode_license_base: |
venv/bin/pytest -n 3 -vvs --test-suite=all \
Expand All @@ -34,7 +34,7 @@ jobs:
--ignore=tests/licensedcode/test_detection_datadriven3.py \
--ignore=tests/licensedcode/test_detection_datadriven4.py \
--ignore=tests/licensedcode/test_additional_license.py \
tests/licensedcode
tests/licensedcode --reruns 2
license_datadriven1_2: |
venv/bin/pytest -n 3 -vvs --test-suite=all \
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
license_cache: |
venv/bin/pytest -n 3 -vvs --test-suite=all \
tests/licensedcode/test_zzzz_cache.py
tests/licensedcode/test_zzzz_cache.py --reruns 2
# this test runs in isolation because it modifies the actual
# license index with additional licenses provided by a plugin
Expand All @@ -98,7 +98,7 @@ jobs:
python_versions: ['3.8', '3.9', '3.10', '3.11']
python_architecture: x64
test_suites:
all: venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
all: venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py --reruns 2

- template: etc/ci/azure-posix.yml
parameters:
Expand All @@ -107,7 +107,7 @@ jobs:
python_versions: ['3.8', '3.9', '3.10', '3.11']
python_architecture: x64
test_suites:
all: venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
all: venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py --reruns 2

- template: etc/ci/azure-posix.yml
parameters:
Expand All @@ -116,7 +116,7 @@ jobs:
python_versions: ['3.8', '3.9', '3.10', '3.11']
python_architecture: x64
test_suites:
all: venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
all: venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py --reruns 2

- template: etc/ci/azure-posix.yml
parameters:
Expand All @@ -125,7 +125,7 @@ jobs:
python_versions: ['3.8', '3.9', '3.10', '3.11']
python_architecture: x64
test_suites:
all: venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
all: venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py --reruns 2

- template: etc/ci/azure-posix.yml
parameters:
Expand All @@ -134,7 +134,7 @@ jobs:
python_versions: ['3.8', '3.9', '3.10', '3.11']
python_architecture: x64
test_suites:
all: venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
all: venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py --reruns 2

- template: etc/ci/azure-win.yml
parameters:
Expand All @@ -143,7 +143,7 @@ jobs:
python_versions: ['3.8']
python_architecture: x64
test_suites:
all: venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py
all: venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py --reruns 2

- template: etc/ci/azure-win.yml
parameters:
Expand All @@ -152,7 +152,7 @@ jobs:
python_versions: ['3.9', '3.10', '3.11']
python_architecture: x64
test_suites:
all: venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py
all: venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py --reruns 2

- template: etc/ci/azure-win.yml
parameters:
Expand All @@ -161,7 +161,7 @@ jobs:
python_versions: ['3.8']
python_architecture: x64
test_suites:
all: venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py
all: venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py --reruns 2

- template: etc/ci/azure-win.yml
parameters:
Expand All @@ -170,7 +170,7 @@ jobs:
python_versions: ['3.9', '3.10', '3.11']
python_architecture: x64
test_suites:
all: venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py
all: venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py --reruns 2


################################################################################
Expand Down
3 changes: 2 additions & 1 deletion setup-mini.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[metadata]
name = scancode-toolkit-mini

This comment has been minimized.

Copy link
@AyanSinhaMahapatra

AyanSinhaMahapatra Jun 6, 2023

Member

@pombredanne there's your bug :P

name = scancode-toolkit
version = 32.0.0rc1
license = Apache-2.0 AND CC-BY-4.0 AND LicenseRef-scancode-other-permissive AND LicenseRef-scancode-other-copyleft

Expand Down Expand Up @@ -133,6 +133,7 @@ testing =
black
isort
vendorize >= 0.3.0
pytest-rerunfailures

docs =
Sphinx >= 3.3.1
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ testing =
black
isort
vendorize >= 0.3.0
pytest-rerunfailures

docs =
Sphinx >= 3.3.1
Expand Down

0 comments on commit dd15f72

Please # to comment.