Skip to content

Commit 934b46a

Browse files
authored
Merge pull request #2254 from webknjaz/testing/gha-verbose-rerun-on-fail
🧪 Set up CI to rerun failed tests verbosely
2 parents aa1be05 + 4813866 commit 934b46a

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,30 @@ jobs:
131131
#
132132
# Ref: https://github.com/tox-dev/tox/issues/3193
133133
run: tox --skip-pkg-install --parallel-live
134+
- name: Re-run the failing tests with maximum verbosity
135+
if: >-
136+
!cancelled()
137+
&& failure()
138+
run: >- # `exit 1` makes sure that the job remains red with flaky runs
139+
python -Xutf8 -Im
140+
tox
141+
--parallel=auto
142+
--parallel-live
143+
--skip-missing-interpreters=false
144+
--skip-pkg-install
145+
-vvvvv
146+
--
147+
--continue-on-collection-errors
148+
--full-trace
149+
--last-failed
150+
${{ !inputs.cpython-pip-version && '--no-cov' || '' }}
151+
--numprocesses=0
152+
--showlocals
153+
--trace-config
154+
-rA
155+
-vvvvv
156+
&& exit 1
157+
shell: bash
134158
- name: Upload coverage to Codecov
135159
if: >-
136160
!inputs.cpython-pip-version
@@ -205,6 +229,29 @@ jobs:
205229
#
206230
# Ref: https://github.com/tox-dev/tox/issues/3193
207231
run: tox --skip-pkg-install --parallel-live
232+
- name: Re-run the failing tests with maximum verbosity
233+
if: >-
234+
!cancelled()
235+
&& failure()
236+
run: >- # `exit 1` makes sure that the job remains red with flaky runs
237+
python -Xutf8 -Im
238+
tox
239+
--parallel=auto
240+
--parallel-live
241+
--skip-missing-interpreters=false
242+
--skip-pkg-install
243+
-vvvvv
244+
--
245+
--continue-on-collection-errors
246+
--full-trace
247+
--last-failed
248+
--numprocesses=0
249+
--showlocals
250+
--trace-config
251+
-rA
252+
-vvvvv
253+
&& exit 1
254+
shell: bash
208255

209256
check: # This job does nothing and is only used for the branch protection
210257
if: always()

changelog.d/2254.contrib.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
The CI is now set up to invoke failed tests again with
2+
maximum level of detail -- by {user}`webknjaz`.
3+
4+
The change is aimed at helping troubleshoot failures
5+
that might be difficult to reproduce locally.

0 commit comments

Comments
 (0)