Skip to content

Commit

Permalink
Add firefox cross browser test to changed packages (#6481)
Browse files Browse the repository at this point in the history
* Add mod github action to run tests on firefox as well as chrome

* Add copyright

* Remove placeholder file

* Remove test comment
  • Loading branch information
dwyfrequency authored Jul 28, 2022
1 parent f5426a5 commit 6a17eb6
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 27 deletions.
80 changes: 55 additions & 25 deletions .github/workflows/test-changed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,61 @@ name: Test Modified Packages
on: pull_request

jobs:
test:
name: Test Packages With Changed Files
test-chrome:
name: Test Packages With Changed Files in Chrome and Node
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@master
with:
# This makes Actions fetch all Git history so run-changed script can diff properly.
fetch-depth: 0
- name: Set up Node (14)
uses: actions/setup-node@v2
with:
node-version: 14.x
- name: install Chrome stable
run: |
sudo apt-get update
sudo apt-get install google-chrome-stable
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
run: |
cp config/ci.config.json config/project.json
yarn
- name: build
run: yarn build:changed core
- name: Run tests on changed packages
run: xvfb-run yarn test:changed core
- name: Checkout Repo
uses: actions/checkout@master
with:
# This makes Actions fetch all Git history so run-changed script can diff properly.
fetch-depth: 0
- name: Set up Node (14)
uses: actions/setup-node@v2
with:
node-version: 14.x
- name: install Chrome stable
run: |
sudo apt-get update
sudo apt-get install google-chrome-stable
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
run: |
cp config/ci.config.json config/project.json
yarn
- name: build
run: yarn build:changed core
- name: Run tests on changed packages
run: xvfb-run yarn test:changed core

test-firefox:
name: Test Packages With Changed Files in Firefox
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@master
with:
fetch-depth: 0
- name: Set up Node (14)
uses: actions/setup-node@v2
with:
node-version: 14.x
- name: install Firefox stable
run: |
sudo apt-get update
sudo apt-get install firefox
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
run: |
cp config/ci.config.json config/project.json
yarn
- name: build
run: yarn build:changed core
- name: Run tests on changed packages
run: xvfb-run yarn test:changed core
env:
BROWSERS: 'Firefox'
2 changes: 1 addition & 1 deletion config/karma.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const config = {
// start these browsers
// available browser launchers:
// https://npmjs.org/browse/keyword/karma-launcher
browsers: ['ChromeHeadless'],
browsers: process.env?.BROWSERS?.split(',') ?? ['ChromeHeadless'],

webpack: webpackTestConfig,

Expand Down
2 changes: 1 addition & 1 deletion packages/storage/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function getTestFiles(argv) {
let unitTestFiles = ['test/unit/*'];
let integrationTestFiles = ['test/integration/*', 'test/browser/*'];

if (argv.unit) {
if (argv.unit || process.env?.BROWSERS) {
return unitTestFiles;
} else if (argv.integration) {
return integrationTestFiles;
Expand Down

0 comments on commit 6a17eb6

Please sign in to comment.