Skip to content

Commit 5695cfb

Browse files
authored
ci: use retry logic for ui tests pipeline step (#1973)
1 parent f7c2083 commit 5695cfb

2 files changed

Lines changed: 48 additions & 8 deletions

File tree

.github/workflows/template-main.yaml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,37 @@ jobs:
5151
- name: 🔧 Install - Test Project
5252
run: npm install --workspace=extester-test
5353

54-
- name: 🔍 Run Tests (macOS, windows)
55-
if: ${{ ! startsWith(matrix.os, 'ubuntu') }}
56-
run: npm test
54+
- name: 🔍 Run Tests (macOS)
55+
uses: nick-fields/retry@v3
56+
if: ${{ startsWith(matrix.os, 'mac') }}
57+
with:
58+
timeout_minutes: 20
59+
retry_wait_seconds: 60
60+
max_attempts: 3
61+
command: npm test
62+
on_retry_command: rm -rf "${RUNNER_TEMP}/extest-code"
63+
64+
- name: 🔍 Run Tests (windows)
65+
uses: nick-fields/retry@v3
66+
if: ${{ startsWith(matrix.os, 'win') }}
67+
with:
68+
timeout_minutes: 20
69+
retry_wait_seconds: 30
70+
max_attempts: 3
71+
command: npm test
5772

5873
- name: ⚙️ Allow unprivileged user namespace (ubuntu)
5974
if: ${{ startsWith(matrix.os, 'ubuntu') }}
6075
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
6176

6277
- name: 🔍 Run Tests (linux)
78+
uses: nick-fields/retry@v3
6379
if: ${{ startsWith(matrix.os, 'ubuntu') }}
64-
run: xvfb-run --auto-servernum --server-args='-screen 0 1920x1080x24' npm test
80+
with:
81+
timeout_minutes: 20
82+
retry_wait_seconds: 30
83+
max_attempts: 3
84+
command: xvfb-run --auto-servernum --server-args='-screen 0 1920x1080x24' npm test
6585

6686
- name: 💾 Upload Screenshots
6787
uses: actions/upload-artifact@v4

.github/workflows/template-runner.yaml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,33 @@ jobs:
6969
if: ${{ startsWith(matrix.os, 'ubuntu') }}
7070
run: xvfb-run --auto-servernum --server-args='-screen 0 1920x1080x24' npm run test:runner:unit
7171

72-
- name: 🔍 Run UI Tests (macOS, windows)
73-
if: ${{ ! startsWith(matrix.os, 'ubuntu') }}
74-
run: npm run test:runner:ui
72+
- name: 🔍 Run UI Tests (macOS)
73+
uses: nick-fields/retry@v3
74+
if: ${{ startsWith(matrix.os, 'mac') }}
75+
with:
76+
timeout_minutes: 10
77+
retry_wait_seconds: 60
78+
max_attempts: 3
79+
command: npm run test:runner:ui
80+
on_retry_command: rm -rf "${RUNNER_TEMP}/extest-code"
81+
82+
- name: 🔍 Run UI Tests (windows)
83+
uses: nick-fields/retry@v3
84+
if: ${{ startsWith(matrix.os, 'win') }}
85+
with:
86+
timeout_minutes: 10
87+
retry_wait_seconds: 30
88+
max_attempts: 3
89+
command: npm run test:runner:ui
7590

7691
- name: 🔍 Run UI Tests (linux)
92+
uses: nick-fields/retry@v3
7793
if: ${{ startsWith(matrix.os, 'ubuntu') }}
78-
run: xvfb-run --auto-servernum --server-args='-screen 0 1920x1080x24' npm run test:runner:ui
94+
with:
95+
timeout_minutes: 10
96+
retry_wait_seconds: 30
97+
max_attempts: 3
98+
command: xvfb-run --auto-servernum --server-args='-screen 0 1920x1080x24' npm run test:runner:ui
7999

80100
- name: 💾 Upload Screenshots
81101
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)