Skip to content

Commit 6a17eb6

Browse files
authored
Add firefox cross browser test to changed packages (#6481)
* Add mod github action to run tests on firefox as well as chrome * Add copyright * Remove placeholder file * Remove test comment
1 parent f5426a5 commit 6a17eb6

File tree

3 files changed

+57
-27
lines changed

3 files changed

+57
-27
lines changed

.github/workflows/test-changed.yml

+55-25
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,61 @@ name: Test Modified Packages
33
on: pull_request
44

55
jobs:
6-
test:
7-
name: Test Packages With Changed Files
6+
test-chrome:
7+
name: Test Packages With Changed Files in Chrome and Node
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- name: Checkout Repo
12-
uses: actions/checkout@master
13-
with:
14-
# This makes Actions fetch all Git history so run-changed script can diff properly.
15-
fetch-depth: 0
16-
- name: Set up Node (14)
17-
uses: actions/setup-node@v2
18-
with:
19-
node-version: 14.x
20-
- name: install Chrome stable
21-
run: |
22-
sudo apt-get update
23-
sudo apt-get install google-chrome-stable
24-
- name: Bump Node memory limit
25-
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
26-
- name: Test setup and yarn install
27-
run: |
28-
cp config/ci.config.json config/project.json
29-
yarn
30-
- name: build
31-
run: yarn build:changed core
32-
- name: Run tests on changed packages
33-
run: xvfb-run yarn test:changed core
11+
- name: Checkout Repo
12+
uses: actions/checkout@master
13+
with:
14+
# This makes Actions fetch all Git history so run-changed script can diff properly.
15+
fetch-depth: 0
16+
- name: Set up Node (14)
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: 14.x
20+
- name: install Chrome stable
21+
run: |
22+
sudo apt-get update
23+
sudo apt-get install google-chrome-stable
24+
- name: Bump Node memory limit
25+
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
26+
- name: Test setup and yarn install
27+
run: |
28+
cp config/ci.config.json config/project.json
29+
yarn
30+
- name: build
31+
run: yarn build:changed core
32+
- name: Run tests on changed packages
33+
run: xvfb-run yarn test:changed core
34+
35+
test-firefox:
36+
name: Test Packages With Changed Files in Firefox
37+
runs-on: ubuntu-latest
38+
39+
steps:
40+
- name: Checkout Repo
41+
uses: actions/checkout@master
42+
with:
43+
fetch-depth: 0
44+
- name: Set up Node (14)
45+
uses: actions/setup-node@v2
46+
with:
47+
node-version: 14.x
48+
- name: install Firefox stable
49+
run: |
50+
sudo apt-get update
51+
sudo apt-get install firefox
52+
- name: Bump Node memory limit
53+
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
54+
- name: Test setup and yarn install
55+
run: |
56+
cp config/ci.config.json config/project.json
57+
yarn
58+
- name: build
59+
run: yarn build:changed core
60+
- name: Run tests on changed packages
61+
run: xvfb-run yarn test:changed core
62+
env:
63+
BROWSERS: 'Firefox'

config/karma.base.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const config = {
6060
// start these browsers
6161
// available browser launchers:
6262
// https://npmjs.org/browse/keyword/karma-launcher
63-
browsers: ['ChromeHeadless'],
63+
browsers: process.env?.BROWSERS?.split(',') ?? ['ChromeHeadless'],
6464

6565
webpack: webpackTestConfig,
6666

packages/storage/karma.conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function getTestFiles(argv) {
3434
let unitTestFiles = ['test/unit/*'];
3535
let integrationTestFiles = ['test/integration/*', 'test/browser/*'];
3636

37-
if (argv.unit) {
37+
if (argv.unit || process.env?.BROWSERS) {
3838
return unitTestFiles;
3939
} else if (argv.integration) {
4040
return integrationTestFiles;

0 commit comments

Comments
 (0)