Skip to content

ci: Fix Firefox error and streamline cross-browser tests #9015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/util/test/errors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ describe('FirebaseError', () => {
throw e;
} catch (error) {
assert.isDefined((error as Error).stack);
// Multi-line match trick - .* does not match \n
assert.match((error as Error).stack!, /FirebaseError[\s\S]/);
// Firefox no longer puts the error class name in the stack
// as of 139.0 so we don't have a string to match on.
}
});

Expand Down
16 changes: 14 additions & 2 deletions scripts/run_tests_in_ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ const crossBrowserPackages = {
'packages/auth': 'test:browser:unit',
'packages/auth-compat': 'test:browser:unit',
'packages/firestore': 'test:browser:unit',
'packages/firestore-compat': 'test:browser'
'packages/firestore-compat': 'test:browser',
'packages/storage': 'test:browser:unit',
'packages/storage-compat': 'test:browser:unit'
};

function writeLogs(status, name, logText) {
Expand Down Expand Up @@ -59,17 +61,27 @@ const argv = yargs.options({
const myPath = argv.d;
let scriptName = argv.s;
const dir = path.resolve(myPath);
const { name } = require(`${dir}/package.json`);
const { name, scripts } = require(`${dir}/package.json`);

let testProcessOutput = '';
try {
if (process.env?.BROWSERS) {
if (scripts['test:browser']) {
scriptName = 'test:browser';
}
for (const package in crossBrowserPackages) {
if (dir.endsWith(package)) {
scriptName = crossBrowserPackages[package];
}
}
}

console.log(
`[${name}][${
process.env.BROWSERS ?? 'chrome/node'
}]: Running script ${scriptName}`
);

const testProcess = spawn('yarn', ['--cwd', dir, scriptName]);

testProcess.childProcess.stdout.on('data', data => {
Expand Down
Loading