Skip to content

Commit

Permalink
Tests: replace karma and testswarm with jQuery test runner
Browse files Browse the repository at this point in the history
- add GH workflow for updating git files on filestash
- selenium is having an issue starting safaridriver when
  loading esmodules. Retries succeed, but inconsistently.
  Leaving that out for now.
  • Loading branch information
timmywil committed Mar 18, 2024
1 parent 2a7bfd6 commit 8242619
Show file tree
Hide file tree
Showing 37 changed files with 10,711 additions and 9,638 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{json,yml}]
indent_style = space
indent_size = 2
68 changes: 68 additions & 0 deletions .github/workflows/browserstack-git.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Browserstack (git)

on:
push:
branches:
- main

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 }}
concurrency:
group: ${{ matrix.BROWSER }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
BROWSER:
- 'IE_11'
- 'Safari_latest'
- 'Safari_latest-1'
- 'Chrome_latest'
- 'Chrome_latest-1'
- 'Opera_latest'
- 'Edge_latest'
- 'Edge_latest-1'
- 'Firefox_latest'
- 'Firefox_latest-1'
- 'Firefox_115'
- '__iOS_17'
- '__iOS_16'
- '__iOS_15'
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- 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@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
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
run: npm run build

- name: Test
run: |
npm run test:unit -- \
-v --browserstack "${{ matrix.BROWSER }}" \
--jquery-migrate dev --jquery-migrate min \
--jquery git --jquery git.min --jquery git.slim --jquery git.slim.min \
--run-id ${{ github.run_id }} \
--retries 3 --hard-retries 1
87 changes: 87 additions & 0 deletions .github/workflows/browserstack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Browserstack

on:
push:
branches:
- main

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 }}
concurrency:
group: ${{ matrix.BROWSER }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
BROWSER:
- 'IE_11'
- 'IE_10'
- 'IE_9'
- 'Safari_latest'
- 'Safari_latest-1'
- 'Chrome_latest'
- 'Chrome_latest-1'
- 'Opera_latest'
- 'Edge_latest'
- 'Edge_latest-1'
- 'Edge_18'
- 'Firefox_latest'
- 'Firefox_latest-1'
- 'Firefox_115'
- 'Firefox_102'
- 'Firefox_91'
- 'Firefox_78'
- 'Firefox_60'
- 'Firefox_48'
- '__iOS_17'
- '__iOS_16'
- '__iOS_15'
- '__iOS_14'
- '__iOS_13'
- '__iOS_12'
- '__iOS_11'
- '__iOS_10'
- '__iOS_9'
- '__iOS_8'
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- 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@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
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
run: npm run build

- name: Test
run: |
npm run test:unit -- \
-v --browserstack "${{ matrix.BROWSER }}" \
--jquery-migrate dev --jquery-migrate min \
--jquery 3.x-git --jquery 3.x-git.min --jquery 3.x-git.slim --jquery 3.x-git.slim.min \
--jquery 3.7.0 --jquery 3.7.0.slim --jquery 3.6.4 --jquery 3.6.4.slim \
--jquery 3.5.1 --jquery 3.5.1.slim --jquery 3.4.1 --jquery 3.4.1.slim \
--jquery 3.3.1 --jquery 3.3.1.slim --jquery 3.2.1 --jquery 3.2.1.slim \
--jquery 3.1.1 --jquery 3.1.1.slim --jquery 3.0.0 --jquery 3.0.0.slim \
--run-id ${{ github.run_id }} \
--retries 3 --hard-retries 1
51 changes: 51 additions & 0 deletions .github/workflows/filestash.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Filestash

on:
push:
branches:
- main

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
update:
runs-on: ubuntu-latest
environment: filestash
env:
NODE_VERSION: 20.x
name: Update Filestash
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- 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@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
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
run: npm run build

- name: Set up SSH
run: |
install --directory ~/.ssh --mode 700
base64 --decode <<< "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -t ed25519 -H "${{ secrets.FILESTASH_SERVER }}" >> ~/.ssh/known_hosts
- name: Upload to Filestash
run: |
rsync dist/jquery-migrate.js filestash@"${{ secrets.FILESTASH_SERVER }}":jquery-migrate-git.js
rsync dist/jquery-migrate.min.js filestash@"${{ secrets.FILESTASH_SERVER }}":jquery-migrate-git.min.js
88 changes: 63 additions & 25 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,75 @@
name: CI
name: Node

on:
pull_request:
push:
branches-ignore: "dependabot/**"

env:
NODE_VERSION: 20.x

jobs:
build:
test:
runs-on: ubuntu-latest
name: ${{ matrix.MIGRATE_VERSION }} - jQuery ${{ matrix.JQUERY_VERSION }} (Chrome/Firefox)
strategy:
fail-fast: false
matrix:
MIGRATE_VERSION: ["min"]
JQUERY_VERSION: ["3.x-git.min", "3.x-git.slim.min"]
include:
- MIGRATE_VERSION: "esmodules"
JQUERY_VERSION: "3.x-git.slim.min"
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- 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@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
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: Run tests
run: npm run test:browser -- --jquery-migrate=${{ matrix.MIGRATE_VERSION }} --jquery=${{ matrix.JQUERY_VERSION }}

safari:
runs-on: macos-latest
name: ${{ matrix.MIGRATE_VERSION }} - jQuery ${{ matrix.JQUERY_VERSION }} (Safari)
strategy:
fail-fast: false
matrix:
# Node.js 10 is required by jQuery infra
NODE_VERSION: [10.x, 18.x]
MIGRATE_VERSION: ["min"]
JQUERY_VERSION: ["3.x-git.min", "3.x-git.slim.min"]
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Cache
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-
- name: Use Node.js ${{ matrix.NODE_VERSION }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ matrix.NODE_VERSION }}

- name: Install npm dependencies
run: npm install

- name: Run test
run: npm run ci
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- 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@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
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: Run tests
run: npm run test:safari -- --jquery-migrate=${{ matrix.MIGRATE_VERSION }} --jquery=${{ matrix.JQUERY_VERSION }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ CDN

/external
/node_modules

# Ignore BrowserStack files
local.log
browserstack.err
Loading

0 comments on commit 8242619

Please sign in to comment.