From 82a66d2f5b4f3948311fedb8ab967fd0c0a7a2bc Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Mon, 12 May 2025 13:55:42 -0700 Subject: [PATCH 1/6] test firefox error --- packages/util/test/errors.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/util/test/errors.test.ts b/packages/util/test/errors.test.ts index 4980b101ee1..c2e642ffffd 100644 --- a/packages/util/test/errors.test.ts +++ b/packages/util/test/errors.test.ts @@ -90,6 +90,8 @@ describe('FirebaseError', () => { } catch (error) { assert.isDefined((error as Error).stack); // Multi-line match trick - .* does not match \n + console.log('** Error stack **'); + console.log((error as Error).stack); assert.match((error as Error).stack!, /FirebaseError[\s\S]/); } }); From cd95c9a12209a3d6d058bce273885c92f6d32160 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 3 Jun 2025 10:26:01 -0700 Subject: [PATCH 2/6] trigger CI From 401bc2ea244ec41f6c6cfa71b898fb4435a982df Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 3 Jun 2025 10:49:55 -0700 Subject: [PATCH 3/6] run test:browser on all browser tests --- config/karma.base.js | 2 ++ scripts/run_tests_in_ci.js | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config/karma.base.js b/config/karma.base.js index 9d92053115f..c62d7302c24 100644 --- a/config/karma.base.js +++ b/config/karma.base.js @@ -20,6 +20,8 @@ const path = require('path'); const webpackTestConfig = require('./webpack.test'); const { argv } = require('yargs'); +// FIXME: trigger all tests + function determineBrowsers() { const supportedBrowsers = ['ChromeHeadless', 'WebkitHeadless', 'Firefox']; diff --git a/scripts/run_tests_in_ci.js b/scripts/run_tests_in_ci.js index 0cf6a7f5d3c..c593017b785 100644 --- a/scripts/run_tests_in_ci.js +++ b/scripts/run_tests_in_ci.js @@ -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) { @@ -67,6 +69,8 @@ const argv = yargs.options({ for (const package in crossBrowserPackages) { if (dir.endsWith(package)) { scriptName = crossBrowserPackages[package]; + } else { + scriptName = "test:browser" } } } From 811801978d8076840b0ac9cf4a023a94ea3b468b Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 3 Jun 2025 11:08:24 -0700 Subject: [PATCH 4/6] try branching logic --- scripts/run_tests_in_ci.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/run_tests_in_ci.js b/scripts/run_tests_in_ci.js index c593017b785..6176a890755 100644 --- a/scripts/run_tests_in_ci.js +++ b/scripts/run_tests_in_ci.js @@ -61,19 +61,28 @@ 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]; - } else { - scriptName = "test:browser" } } + // console.log( + // `[${name}][${process.env.BROWSERS}]: Running script ${scriptName}` + // ); } + + console.log( + `[${name}][${process.env.BROWSERS ?? 'chrome/node'}]: Running script ${scriptName}` + ); + const testProcess = spawn('yarn', ['--cwd', dir, scriptName]); testProcess.childProcess.stdout.on('data', data => { From 9a50c1e4dc6a8afbdef222f2ed3e9aa7cb59299d Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 3 Jun 2025 11:40:55 -0700 Subject: [PATCH 5/6] adjust util test --- config/karma.base.js | 2 -- packages/util/test/errors.test.ts | 6 ++---- scripts/run_tests_in_ci.js | 6 ++++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/config/karma.base.js b/config/karma.base.js index c62d7302c24..9d92053115f 100644 --- a/config/karma.base.js +++ b/config/karma.base.js @@ -20,8 +20,6 @@ const path = require('path'); const webpackTestConfig = require('./webpack.test'); const { argv } = require('yargs'); -// FIXME: trigger all tests - function determineBrowsers() { const supportedBrowsers = ['ChromeHeadless', 'WebkitHeadless', 'Firefox']; diff --git a/packages/util/test/errors.test.ts b/packages/util/test/errors.test.ts index c2e642ffffd..6cb6273d326 100644 --- a/packages/util/test/errors.test.ts +++ b/packages/util/test/errors.test.ts @@ -89,10 +89,8 @@ describe('FirebaseError', () => { throw e; } catch (error) { assert.isDefined((error as Error).stack); - // Multi-line match trick - .* does not match \n - console.log('** Error stack **'); - console.log((error as Error).stack); - 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. } }); diff --git a/scripts/run_tests_in_ci.js b/scripts/run_tests_in_ci.js index 6176a890755..3a57bab7206 100644 --- a/scripts/run_tests_in_ci.js +++ b/scripts/run_tests_in_ci.js @@ -67,7 +67,7 @@ const argv = yargs.options({ try { if (process.env?.BROWSERS) { if (scripts['test:browser']) { - scriptName = 'test:browser'; + scriptName = 'test:browser'; } for (const package in crossBrowserPackages) { if (dir.endsWith(package)) { @@ -80,7 +80,9 @@ const argv = yargs.options({ } console.log( - `[${name}][${process.env.BROWSERS ?? 'chrome/node'}]: Running script ${scriptName}` + `[${name}][${ + process.env.BROWSERS ?? 'chrome/node' + }]: Running script ${scriptName}` ); const testProcess = spawn('yarn', ['--cwd', dir, scriptName]); From 2ac7821201056537f7437eb0f20fddec20f7d65e Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Wed, 4 Jun 2025 11:06:53 -0700 Subject: [PATCH 6/6] remove extra comment --- scripts/run_tests_in_ci.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/run_tests_in_ci.js b/scripts/run_tests_in_ci.js index 3a57bab7206..7252b6acc3c 100644 --- a/scripts/run_tests_in_ci.js +++ b/scripts/run_tests_in_ci.js @@ -74,9 +74,6 @@ const argv = yargs.options({ scriptName = crossBrowserPackages[package]; } } - // console.log( - // `[${name}][${process.env.BROWSERS}]: Running script ${scriptName}` - // ); } console.log(