diff options
author | Timmy Willison <timmywil@users.noreply.github.com> | 2024-06-02 11:48:01 -0400 |
---|---|---|
committer | Timmy Willison <timmywil@users.noreply.github.com> | 2024-06-04 09:50:24 -0400 |
commit | 0ad158db12c9365f702bac15ef5d5692532b1f8f (patch) | |
tree | 997a0949271b0d797b031781d9152d969ce9d27b | |
parent | 05d03ee38d29f2ac830bee7c1e16a8e9151706f7 (diff) | |
download | jquery-ui-0ad158db12c9365f702bac15ef5d5692532b1f8f.tar.gz jquery-ui-0ad158db12c9365f702bac15ef5d5692532b1f8f.zip |
Tests: add dispatchable workflow for running tests in all supported browsers
- reduce max worker restarts to avoid extra long runs
Closes gh-2256
-rw-r--r-- | .github/workflows/browserstack.yml | 73 | ||||
-rw-r--r-- | tests/runner/browsers.js | 4 | ||||
-rw-r--r-- | tests/runner/run.js | 2 |
3 files changed, 76 insertions, 3 deletions
diff --git a/.github/workflows/browserstack.yml b/.github/workflows/browserstack.yml new file mode 100644 index 000000000..6dcc7528f --- /dev/null +++ b/.github/workflows/browserstack.yml @@ -0,0 +1,73 @@ +name: Browserstack + +on: + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + environment: browserstack + env: + BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} + BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} + NODE_VERSION: 20.x + name: | + ${{ matrix.BROWSER }} | ${{ matrix.JQUERYS.name }} + concurrency: + group: ${{ matrix.BROWSER }}-${{ matrix.JQUERYS.name }} + strategy: + fail-fast: false + matrix: + BROWSER: + - 'Chrome_latest' + - 'Chrome_latest-1' + - 'Edge_18' + - 'Edge_latest' + - 'Edge_latest-1' + - 'Firefox_latest' + - 'Firefox_latest-1' + - 'IE_11' + - 'Opera_latest' + - 'Opera_latest-1' + - 'Safari_latest' + - 'Safari_latest-1' + JQUERYS: + - versions: --jquery 3.x-git --jquery git + name: jQuery git + - 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 + name: jQuery 3.x + - versions: --jquery 2.2.4 --jquery 2.1.4 --jquery 2.0.3 + name: jQuery 2.x + - versions: --jquery 1.12.4 --jquery 1.11.3 --jquery 1.10.2 --jquery 1.9.1 --jquery 1.8.3 + name: jQuery 1.x + + steps: + - name: Checkout + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Cache + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock- + + - name: Install dependencies + run: npm install + + - name: Build jQuery UI + run: npm run build + + - name: Run tests + run: | + npm run test:unit -- -v \ + --browserstack "${{ matrix.BROWSER }}" \ + ${{ matrix.JQUERYS.versions }} \ + --run-id ${{ github.run_id }} \ + --retries 3 --hard-retries 1 diff --git a/tests/runner/browsers.js b/tests/runner/browsers.js index 1ddccdf78..5b55142e2 100644 --- a/tests/runner/browsers.js +++ b/tests/runner/browsers.js @@ -29,7 +29,7 @@ const workers = Object.create( null ); const ACKNOWLEDGE_INTERVAL = 1000; const ACKNOWLEDGE_TIMEOUT = 60 * 1000 * 5; -const MAX_WORKER_RESTARTS = 5; +const MAX_WORKER_RESTARTS = 3; // No report after the time limit // should refresh the worker @@ -64,7 +64,7 @@ export async function createBrowserWorker( url, browser, options, restarts = 0 ) worker = await createWorker( { ...browser, url: encodeURI( url ), - project: "jquery", + project: "jquery-ui", build: `Run ${ runId }`, // This is the maximum timeout allowed diff --git a/tests/runner/run.js b/tests/runner/run.js index 9c4f8d479..dbb6c7dc8 100644 --- a/tests/runner/run.js +++ b/tests/runner/run.js @@ -277,7 +277,7 @@ export async function run( { for ( const browser of browsers ) { for ( const suite of suites ) { - queueRuns( [ suite ], browser ); + queueRuns( suite, browser ); } } |