Skip to content

Commit f88805e

Browse files
authored
Update Auth Firefox cross browser action to only run on changed auth files (#6546)
* Update trigger condition for cross browser tests * Update github action * touch auth file * Revert touching auth file * Add note describing crossBrowserPackages object * Update comment describing crossBrowserPackages
1 parent bea604e commit f88805e

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

.github/workflows/test-changed-auth.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ jobs:
6363
- name: build
6464
run: yarn build:changed auth
6565
- name: Run tests on auth changed packages
66-
run: xvfb-run yarn --cwd packages/auth test:browser:unit
67-
env:
68-
BROWSERS: 'Firefox'
69-
- name: Run tests on auth-compat changed packages
70-
run: xvfb-run yarn --cwd packages/auth-compat test:browser:unit
66+
run: xvfb-run yarn test:changed auth
7167
env:
7268
BROWSERS: 'Firefox'

scripts/run_tests_in_ci.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ const { spawn } = require('child-process-promise');
2121
const { writeFileSync } = require('fs');
2222

2323
const LOGDIR = process.env.CI ? process.env.HOME : '/tmp';
24+
// Maps the packages where we should not run `test:all` and instead isolate the cross-browser tests.
25+
// TODO(dwyfrequency): Update object with `storage` and `firestore` packages.
26+
const crossBrowserPackages = { 'packages/auth': 'test:browser:unit' };
2427

2528
function writeLogs(status, name, logText) {
2629
const safeName = name.replace(/@/g, 'at_').replace(/\//g, '_');
@@ -49,13 +52,20 @@ const argv = yargs.options({
4952

5053
(async () => {
5154
const myPath = argv.d;
52-
const scriptName = argv.s;
55+
let scriptName = argv.s;
5356
const dir = path.resolve(myPath);
5457
const { name } = require(`${dir}/package.json`);
5558

5659
let stdout = '';
5760
let stderr = '';
5861
try {
62+
if (process.env?.BROWSERS) {
63+
for (const package in crossBrowserPackages) {
64+
if (dir.endsWith(package)) {
65+
scriptName = crossBrowserPackages[package];
66+
}
67+
}
68+
}
5969
const testProcess = spawn('yarn', ['--cwd', dir, scriptName]);
6070

6171
testProcess.childProcess.stdout.on('data', data => {

0 commit comments

Comments
 (0)