From e021f47978a7312ffa5525d2fd4b7a9f083b800c Mon Sep 17 00:00:00 2001 From: dwyfrequency Date: Wed, 27 Jul 2022 17:32:58 -0400 Subject: [PATCH 1/4] Add mod github action to run tests on firefox as well as chrome --- .github/workflows/test-changed.yml | 80 ++++++++++++++++++++--------- config/karma.base.js | 2 +- packages/analytics/src/api.ts | 1 + packages/storage/karma.conf.js | 2 +- packages/storage/src/placeholder.ts | 1 + 5 files changed, 59 insertions(+), 27 deletions(-) create mode 100644 packages/storage/src/placeholder.ts diff --git a/.github/workflows/test-changed.yml b/.github/workflows/test-changed.yml index 6f86e38e7ed..7455435147b 100644 --- a/.github/workflows/test-changed.yml +++ b/.github/workflows/test-changed.yml @@ -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 \ No newline at end of file + - 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' diff --git a/config/karma.base.js b/config/karma.base.js index 83a1031c010..593de711579 100644 --- a/config/karma.base.js +++ b/config/karma.base.js @@ -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, diff --git a/packages/analytics/src/api.ts b/packages/analytics/src/api.ts index 423092361d9..4a79f203498 100644 --- a/packages/analytics/src/api.ts +++ b/packages/analytics/src/api.ts @@ -17,6 +17,7 @@ * limitations under the License. */ +// WHo is doing this???? import { _getProvider, FirebaseApp, getApp } from '@firebase/app'; import { Analytics, diff --git a/packages/storage/karma.conf.js b/packages/storage/karma.conf.js index cae7c2a48e9..c6d44ef1693 100644 --- a/packages/storage/karma.conf.js +++ b/packages/storage/karma.conf.js @@ -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; diff --git a/packages/storage/src/placeholder.ts b/packages/storage/src/placeholder.ts new file mode 100644 index 00000000000..a2248efc6c9 --- /dev/null +++ b/packages/storage/src/placeholder.ts @@ -0,0 +1 @@ +console.log('test'); From ea6fbf17ed76ad282f448e97b939ba5f603e4dc3 Mon Sep 17 00:00:00 2001 From: dwyfrequency Date: Wed, 27 Jul 2022 17:48:30 -0400 Subject: [PATCH 2/4] Add copyright --- packages/storage/src/placeholder.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/storage/src/placeholder.ts b/packages/storage/src/placeholder.ts index a2248efc6c9..d482ea7ef46 100644 --- a/packages/storage/src/placeholder.ts +++ b/packages/storage/src/placeholder.ts @@ -1 +1,18 @@ +/** + * @license + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + console.log('test'); From fb1aa724d2d12bc4ca73ec816188d04fd2031f70 Mon Sep 17 00:00:00 2001 From: dwyfrequency Date: Thu, 28 Jul 2022 11:28:40 -0400 Subject: [PATCH 3/4] Remove placeholder file --- packages/storage/src/placeholder.ts | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 packages/storage/src/placeholder.ts diff --git a/packages/storage/src/placeholder.ts b/packages/storage/src/placeholder.ts deleted file mode 100644 index d482ea7ef46..00000000000 --- a/packages/storage/src/placeholder.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -console.log('test'); From e85dda5e1a81b0ec065c12d0e3f7b0304ffc33fe Mon Sep 17 00:00:00 2001 From: dwyfrequency Date: Thu, 28 Jul 2022 13:58:41 -0400 Subject: [PATCH 4/4] Remove test comment --- packages/analytics/src/api.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/analytics/src/api.ts b/packages/analytics/src/api.ts index 4a79f203498..423092361d9 100644 --- a/packages/analytics/src/api.ts +++ b/packages/analytics/src/api.ts @@ -17,7 +17,6 @@ * limitations under the License. */ -// WHo is doing this???? import { _getProvider, FirebaseApp, getApp } from '@firebase/app'; import { Analytics,