Skip to content

Commit cc887e6

Browse files
authored
Merge pull request #3207 from nexB/rerun-flaky-tests-in-ci
Work around heisen-failures in CI
2 parents 18a842e + dd15f72 commit cc887e6

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

azure-pipelines.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
venv/bin/pytest -n 3 -vvs --test-suite=all \
2323
--ignore=tests/cluecode \
2424
--ignore=tests/licensedcode \
25-
--ignore=tests/scancode/test_cli.py
25+
--ignore=tests/scancode/test_cli.py --reruns 2
2626
2727
cluecode_license_base: |
2828
venv/bin/pytest -n 3 -vvs --test-suite=all \
@@ -34,7 +34,7 @@ jobs:
3434
--ignore=tests/licensedcode/test_detection_datadriven3.py \
3535
--ignore=tests/licensedcode/test_detection_datadriven4.py \
3636
--ignore=tests/licensedcode/test_additional_license.py \
37-
tests/licensedcode
37+
tests/licensedcode --reruns 2
3838
3939
license_datadriven1_2: |
4040
venv/bin/pytest -n 3 -vvs --test-suite=all \
@@ -77,7 +77,7 @@ jobs:
7777
7878
license_cache: |
7979
venv/bin/pytest -n 3 -vvs --test-suite=all \
80-
tests/licensedcode/test_zzzz_cache.py
80+
tests/licensedcode/test_zzzz_cache.py --reruns 2
8181
8282
# this test runs in isolation because it modifies the actual
8383
# license index with additional licenses provided by a plugin
@@ -98,7 +98,7 @@ jobs:
9898
python_versions: ['3.8', '3.9', '3.10', '3.11']
9999
python_architecture: x64
100100
test_suites:
101-
all: venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
101+
all: venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py --reruns 2
102102

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

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

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

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

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

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

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

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

175175

176176
################################################################################

setup-mini.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[metadata]
2-
name = scancode-toolkit-mini
2+
name = scancode-toolkit
33
version = 32.0.0rc1
44
license = Apache-2.0 AND CC-BY-4.0 AND LicenseRef-scancode-other-permissive AND LicenseRef-scancode-other-copyleft
55

@@ -133,6 +133,7 @@ testing =
133133
black
134134
isort
135135
vendorize >= 0.3.0
136+
pytest-rerunfailures
136137

137138
docs =
138139
Sphinx >= 3.3.1

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ testing =
133133
black
134134
isort
135135
vendorize >= 0.3.0
136+
pytest-rerunfailures
136137

137138
docs =
138139
Sphinx >= 3.3.1

0 commit comments

Comments
 (0)