Skip to content

Commit 18ca85d

Browse files
qunit tests: fix runner stalled freezes (#31274)
Co-authored-by: Vladislav Volkov <dxvladislavvolkov@users.noreply.github.com>
1 parent 6a5eacf commit 18ca85d

40 files changed

Lines changed: 394 additions & 165 deletions

File tree

.github/actions/run-qunit-tests/action.yml

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ inputs:
2525
useCsp:
2626
description: "Indicates if tests should run with Content Security Policy (CSP) enabled"
2727
default: "true"
28+
maxWorkers:
29+
description: "Maximum number of parallel test workers"
30+
default: ""
2831

2932
runs:
3033
using: composite
@@ -36,23 +39,15 @@ runs:
3639
echo "MATRIX_ENVS_NAME_SAFE=$MATRIX_ENVS_NAME_SAFE"
3740
echo "MATRIX_ENVS_NAME_SAFE=$MATRIX_ENVS_NAME_SAFE" >> $GITHUB_ENV
3841
39-
# - name: Update apt
40-
# run: |
41-
# sudo apt-get update
42-
43-
# - name: Setup utils
44-
# run: |
45-
# sudo apt-get install -y dbus-x11 httping x11vnc xvfb
42+
# - name: Setup Chrome
43+
# uses: ./.github/actions/setup-chrome-headless-shell
44+
# with:
45+
# chrome-version: '141.0.7390.122'
4646

47-
- name: Setup Chrome
48-
uses: ./.github/actions/setup-chrome-headless-shell
49-
with:
50-
chrome-version: '141.0.7390.122'
51-
52-
- name: Use Node.js
53-
uses: actions/setup-node@v4
54-
with:
55-
node-version: '20'
47+
# - name: Use Node.js
48+
# uses: actions/setup-node@v4
49+
# with:
50+
# node-version: '20'
5651

5752
- name: Download artifacts
5853
uses: actions/download-artifact@v4
@@ -108,14 +103,14 @@ runs:
108103
NORENOVATION: "false"
109104
GITHUBACTION: "true"
110105
TARGET: "test"
111-
DISPLAY: ":99"
112106
CHROME_CMD: ${{ env.CHROME_SHELL }}
107+
MAX_WORKERS: ${{ inputs.maxWorkers }}
113108
run: |
114109
chmod +x ./docker-ci.sh
115110
./docker-ci.sh
116111
117112
- name: Copy RawLog.txt
118-
if: ${{ failure() }}
113+
if: ${{ always() }}
119114
uses: actions/upload-artifact@v4
120115
with:
121116
name: RawLog-${{ env.MATRIX_ENVS_NAME_SAFE }}

.github/copilot-instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,10 @@ npm run lint-staged
251251
- Checks wrapper regeneration is up-to-date
252252
- Timeout: 20 minutes
253253

254-
**5. QUnit Tests (`.github/workflows/qunit_tests-renovation.yml`):**
254+
**5. QUnit Tests (`.github/workflows/qunit_tests.yml`):**
255255
- Builds with `DEVEXTREME_TEST_CI=true`
256256
- Runs tests in parallel across multiple constellations
257-
- Timeout: 60 minutes
257+
- Timeout: 20 minutes
258258

259259
**6. TestCafe Tests (`.github/workflows/testcafe_tests.yml`):**
260260
- Accessibility tests across multiple themes

.github/workflows/demos_visual_tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -737,11 +737,11 @@ jobs:
737737
id: set-concurrency
738738
run: |
739739
if [[ "${{ matrix.CONSTEL }}" == react* ]]; then
740-
echo "concurrency=3" >> $GITHUB_OUTPUT
740+
echo "concurrency=4" >> $GITHUB_OUTPUT
741741
elif [[ "${{ matrix.CONSTEL }}" == angular* ]]; then
742-
echo "concurrency=2" >> $GITHUB_OUTPUT
742+
echo "concurrency=3" >> $GITHUB_OUTPUT
743743
else
744-
echo "concurrency=2" >> $GITHUB_OUTPUT
744+
echo "concurrency=3" >> $GITHUB_OUTPUT
745745
fi
746746
747747
- name: Run TestCafe tests

.github/workflows/qunit_tests.yml

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -89,40 +89,36 @@ jobs:
8989
needs: build
9090
runs-on: devextreme-shr2
9191
name: Constel ${{ matrix.CONSTEL }}${{ matrix.TIMEZONE != '' && format('-{0}', matrix.TIMEZONE) || '' }}${{ matrix.CSP == 'false' && '-no-csp' || '' }}
92-
timeout-minutes: 60
92+
timeout-minutes: 20
9393
strategy:
9494
fail-fast: false
9595
matrix:
9696
CONSTEL: [
97-
export,
9897
misc,
9998
ui,
10099
ui.editors,
101-
ui.htmlEditor,
102100
ui.grid,
103-
ui.scheduler(1/2),
104-
ui.scheduler(2/2),
105-
viz
101+
ui.scheduler,
106102
]
107103
TIMEZONE: ['']
108104
CSP: ['true']
109105
useJQuery: ['false']
106+
MAX_WORKERS: ['']
110107
include:
111-
- CONSTEL: ui.scheduler(1/2)
112-
TIMEZONE: US/Pacific
108+
- CONSTEL: export
109+
MAX_WORKERS: '3'
113110
useJQuery: 'false'
114-
- CONSTEL: ui.scheduler(2/2)
111+
CSP: 'true'
112+
- CONSTEL: ui.scheduler
115113
TIMEZONE: US/Pacific
116114
useJQuery: 'false'
117115
- CONSTEL: misc
118116
CSP: 'false'
119117
useJQuery: 'true'
120-
- CONSTEL: ui.widgets(1/2)
121-
CSP: 'false'
122-
useJQuery: 'false'
123-
- CONSTEL: ui.widgets(2/2)
118+
- CONSTEL: ui.widgets
124119
CSP: 'false'
125120
useJQuery: 'false'
121+
MAX_WORKERS: '3'
126122

127123
steps:
128124
- name: Get sources
@@ -136,6 +132,7 @@ jobs:
136132
timezone: ${{ matrix.TIMEZONE }}
137133
useJQuery: ${{ matrix.useJQuery }}
138134
useCsp: ${{ matrix.CSP }}
135+
maxWorkers: ${{ matrix.MAX_WORKERS || '' }}
139136

140137
qunit-tests-shadow-dom:
141138
needs: [check-should-run-all, build]
@@ -148,16 +145,10 @@ jobs:
148145
matrix:
149146
constel: [
150147
'ui',
151-
'ui.widgets(1/2)',
152-
'ui.widgets(2/2)',
153-
'ui.editors(1/2)',
154-
'ui.editors(2/2)',
155-
'ui.htmlEditor',
156-
'ui.grid(1/2)',
157-
'ui.grid(2/2)',
158-
'ui.scheduler(1/2)',
159-
'ui.scheduler(2/2)',
160-
'viz'
148+
'ui.widgets',
149+
'ui.editors',
150+
'ui.grid',
151+
'ui.scheduler',
161152
]
162153

163154
steps:
@@ -172,6 +163,7 @@ jobs:
172163
useJQuery: 'true'
173164
useShadowDom: 'true'
174165
useCsp: 'true'
166+
maxWorkers: ${{ (matrix.constel == 'ui.editors' || matrix.constel == 'ui.widgets') && '3' || '' }}
175167

176168
notify:
177169
runs-on: devextreme-shr2

.github/workflows/testcafe_tests.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,10 @@ jobs:
102102
{ name: "material - compact", theme: 'material.blue.light.compact' },
103103

104104
{ componentFolder: "cardView", name: "cardView" },
105-
{ componentFolder: "dataGrid", name: "dataGrid (1/3)", indices: "1/3" },
106-
{ componentFolder: "dataGrid", name: "dataGrid (2/3)", indices: "2/3" },
107-
{ componentFolder: "dataGrid", name: "dataGrid (3/3)", indices: "3/3" },
105+
{ componentFolder: "dataGrid", name: "dataGrid (1/4)", indices: "1/4", cache: true },
106+
{ componentFolder: "dataGrid", name: "dataGrid (2/4)", indices: "2/4", cache: true },
107+
{ componentFolder: "dataGrid", name: "dataGrid (3/4)", indices: "3/4", cache: true },
108+
{ componentFolder: "dataGrid", name: "dataGrid (4/4)", indices: "4/4", cache: true },
108109

109110
{ componentFolder: "editors", name: "editors" },
110111
{ componentFolder: "navigation", name: "navigation" },
@@ -139,10 +140,10 @@ jobs:
139140
working-directory: ./packages/devextreme
140141
run: 7z x artifacts.zip -aoa
141142

142-
- name: Setup Chrome
143-
uses: ./.github/actions/setup-chrome
144-
with:
145-
chrome-version: '141.0.7390.122'
143+
# - name: Setup Chrome
144+
# uses: ./.github/actions/setup-chrome
145+
# with:
146+
# chrome-version: '141.0.7390.122'
146147

147148
- name: Use Node.js
148149
uses: actions/setup-node@v4
@@ -182,24 +183,25 @@ jobs:
182183
[ "${{ matrix.ARGS.indices }}" != "" ] && INDICES="--indices ${{ matrix.ARGS.indices }}"
183184
[ "${{ matrix.ARGS.concurrency }}" != "" ] && CONCURRENCY="--concurrency ${{ matrix.ARGS.concurrency }}"
184185
[ "${{ matrix.ARGS.platform }}" != "" ] && PLATFORM="--platform ${{ matrix.ARGS.platform }}"
185-
all_args="--browsers=chrome:devextreme-shr2 --componentFolder ${{ matrix.ARGS.componentFolder }} $CONCURRENCY $INDICES $PLATFORM $THEME"
186+
[ "${{ matrix.ARGS.cache }}" == "true" ] && CACHE="--cache true"
187+
all_args="--browsers=chrome:devextreme-shr2 --componentFolder ${{ matrix.ARGS.componentFolder }} $CONCURRENCY $INDICES $PLATFORM $THEME $CACHE"
186188
echo "$all_args"
187189
pnpm run test $all_args
188190
189191
- name: Sanitize job name
190-
if: ${{ failure() }}
192+
if: ${{ always() }}
191193
run: echo "JOB_NAME=$(echo "${{ matrix.ARGS.name }}" | tr '/' '-')" >> $GITHUB_ENV
192194

193195
- name: Copy compared screenshot artifacts
194-
if: ${{ failure() }}
196+
if: ${{ always() }}
195197
uses: actions/upload-artifact@v4
196198
with:
197199
name: compared-screenshots-${{ env.JOB_NAME }}
198200
path: ${{ github.workspace }}/e2e/testcafe-devextreme/artifacts/compared-screenshots/**/*
199201
if-no-files-found: ignore
200202

201203
- name: Copy failed test artifacts
202-
if: ${{ failure() }}
204+
if: ${{ always() }}
203205
uses: actions/upload-artifact@v4
204206
with:
205207
name: failed-tests-${{ env.JOB_NAME }}
@@ -209,7 +211,7 @@ jobs:
209211
merge-artifacts:
210212
runs-on: devextreme-shr2
211213
needs: testcafe
212-
if: ${{ failure() }}
214+
if: ${{ always() }}
213215

214216
steps:
215217
- name: Merge screenshot artifacts

apps/demos/utils/visual-tests/testcafe-runner.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import createTestCafe from 'testcafe';
22
import { ClientFunction } from 'testcafe';
3-
import { THEME } from './helpers/theme-utils';
43
import fs from 'fs';
54

65
const LAUNCH_RETRY_ATTEMPTS = 3;
@@ -79,9 +78,7 @@ function accessibilityTestCafeReporter() {
7978
}
8079

8180
async function main() {
82-
const tester = await createTestCafe({
83-
cache: true,
84-
});
81+
const tester = await createTestCafe({});
8582
const runner = tester.createRunner();
8683
const concurrency = (process.env.CONCURRENCY && (+process.env.CONCURRENCY)) || 1;
8784

e2e/testcafe-devextreme/runner.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ interface ParsedArgs {
5858
retryFailed: boolean;
5959
}
6060

61-
const TESTCAFE_CONFIG: Partial<TestCafeConfigurationOptions> = {
61+
const getTestCafeConfig = (cache: boolean): Partial<TestCafeConfigurationOptions> => ({
6262
hostname: 'localhost',
6363
port1: 1437,
6464
port2: 1438,
65-
cache: true,
66-
};
65+
cache,
66+
});
6767

6868
const changeTheme = async (t: TestController, themeName: string): Promise<void> => {
6969
const changeThemeClientFn = ClientFunction(() => new Promise<void>((resolve) => {
@@ -106,7 +106,7 @@ function getArgs(): ParsedArgs {
106106
reporter: 'spec-time',
107107
componentFolder: '',
108108
file: '*',
109-
cache: true,
109+
cache: false,
110110
quarantineMode: false,
111111
indices: '',
112112
platform: '',
@@ -123,9 +123,8 @@ async function main() {
123123
let testCafe: Awaited<ReturnType<typeof createTestCafe>> | null = null;
124124

125125
try {
126-
testCafe = await createTestCafe(TESTCAFE_CONFIG);
127-
128126
const args = getArgs();
127+
testCafe = await createTestCafe(getTestCafeConfig(args.cache));
129128

130129
const testName = args.test.trim();
131130
const reporter = typeof args.reporter === 'string' ? args.reporter.trim() : args.reporter;
1.09 KB
Loading
1.07 KB
Loading
-54 Bytes
Loading

0 commit comments

Comments
 (0)