Skip to content

Commit 0ad158d

Browse files
committed
Tests: add dispatchable workflow for running tests in all supported browsers
- reduce max worker restarts to avoid extra long runs Closes gh-2256
1 parent 05d03ee commit 0ad158d

File tree

3 files changed

+76
-3
lines changed

3 files changed

+76
-3
lines changed

.github/workflows/browserstack.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Browserstack
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
environment: browserstack
10+
env:
11+
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
12+
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
13+
NODE_VERSION: 20.x
14+
name: |
15+
${{ matrix.BROWSER }} | ${{ matrix.JQUERYS.name }}
16+
concurrency:
17+
group: ${{ matrix.BROWSER }}-${{ matrix.JQUERYS.name }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
BROWSER:
22+
- 'Chrome_latest'
23+
- 'Chrome_latest-1'
24+
- 'Edge_18'
25+
- 'Edge_latest'
26+
- 'Edge_latest-1'
27+
- 'Firefox_latest'
28+
- 'Firefox_latest-1'
29+
- 'IE_11'
30+
- 'Opera_latest'
31+
- 'Opera_latest-1'
32+
- 'Safari_latest'
33+
- 'Safari_latest-1'
34+
JQUERYS:
35+
- versions: --jquery 3.x-git --jquery git
36+
name: jQuery git
37+
- versions: --jquery 3.7.1 --jquery 3.6.4 --jquery 3.5.1 --jquery 3.4.1 --jquery 3.3.1 --jquery 3.2.1 --jquery 3.1.1 --jquery 3.0.0
38+
name: jQuery 3.x
39+
- versions: --jquery 2.2.4 --jquery 2.1.4 --jquery 2.0.3
40+
name: jQuery 2.x
41+
- versions: --jquery 1.12.4 --jquery 1.11.3 --jquery 1.10.2 --jquery 1.9.1 --jquery 1.8.3
42+
name: jQuery 1.x
43+
44+
steps:
45+
- name: Checkout
46+
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
47+
48+
- name: Use Node.js ${{ env.NODE_VERSION }}
49+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
50+
with:
51+
node-version: ${{ env.NODE_VERSION }}
52+
53+
- name: Cache
54+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
55+
with:
56+
path: ~/.npm
57+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
58+
restore-keys: |
59+
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
60+
61+
- name: Install dependencies
62+
run: npm install
63+
64+
- name: Build jQuery UI
65+
run: npm run build
66+
67+
- name: Run tests
68+
run: |
69+
npm run test:unit -- -v \
70+
--browserstack "${{ matrix.BROWSER }}" \
71+
${{ matrix.JQUERYS.versions }} \
72+
--run-id ${{ github.run_id }} \
73+
--retries 3 --hard-retries 1

tests/runner/browsers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const workers = Object.create( null );
2929
const ACKNOWLEDGE_INTERVAL = 1000;
3030
const ACKNOWLEDGE_TIMEOUT = 60 * 1000 * 5;
3131

32-
const MAX_WORKER_RESTARTS = 5;
32+
const MAX_WORKER_RESTARTS = 3;
3333

3434
// No report after the time limit
3535
// should refresh the worker
@@ -64,7 +64,7 @@ export async function createBrowserWorker( url, browser, options, restarts = 0 )
6464
worker = await createWorker( {
6565
...browser,
6666
url: encodeURI( url ),
67-
project: "jquery",
67+
project: "jquery-ui",
6868
build: `Run ${ runId }`,
6969

7070
// This is the maximum timeout allowed

tests/runner/run.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ export async function run( {
277277

278278
for ( const browser of browsers ) {
279279
for ( const suite of suites ) {
280-
queueRuns( [ suite ], browser );
280+
queueRuns( suite, browser );
281281
}
282282
}
283283

0 commit comments

Comments
 (0)