Skip to content

Commit

Permalink
[CI] update chrome install steps for Auth builds. (#7602)
Browse files Browse the repository at this point in the history
Update the Chrome installation steps to use the new method of installation. This unlocks us to test against the latest and greatest chrome versions.

Changes include:
 * The use of puppeteer to install chrome on the CI VMs.
 * An update to the chromedriver npm module so that it may be properly configured to use the new Chrome download URLs.
 * An update of node from v14 to v16 for all CI runners. The latest version of Chrome Driver requires at v16+.
 * The addition of `--npm-path npm` to all `run-s` and `run-p` invocations, as they otherwise fail when invoked via `npx` on node v16.
 * Removed the installation of chrome in the `Test Auth on Firefox If Changed` in `test-changed-auth.yml` as it seemed like it seemed superfluous.
  • Loading branch information
DellaBitta committed Sep 14, 2023
1 parent e5b96d7 commit 2be12d7
Show file tree
Hide file tree
Showing 36 changed files with 132 additions and 144 deletions.
27 changes: 10 additions & 17 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
env:
# make chromedriver detect installed Chrome version and download the corresponding driver
DETECT_CHROMEDRIVER_VERSION: true
# The default behavior of chromedriver uses the older Chrome download URLs. We need to override
# the beahvior to use the new URLs.
CHROMEDRIVER_CDNURL: https://googlechromelabs.github.io/
CHROMEDRIVER_CDNBINARIESURL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/
artifactRetentionDays: 14

jobs:
Expand All @@ -17,14 +21,8 @@ jobs:
# Install Chrome so the correct version of webdriver can be installed by chromedriver when
# setting up the repo. This must be done to build and execute Auth properly.
- name: install Chrome stable
# Pin Chrome version 114.0.5735.90-1 to avoid install failures like "No such object: chromedriver/LATEST_RELEASE_115.0.5790".
# The failure happens because https://chromedriver.chromium.org/downloads only goes up to version 114.
# TODO(b/297380444) Update script to install the latest Chrome and ChromeDriver.
run: |
sudo apt-get update
sudo apt-get install wget
sudo wget http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.90-1_amd64.deb
sudo apt-get install -f ./google-chrome-stable_114.0.5735.90-1_amd64.deb --allow-downgrades
npx @puppeteer/browsers install chrome@stable
- uses: actions/checkout@v3
- name: Set up Node (16)
uses: actions/setup-node@v3
Expand Down Expand Up @@ -101,16 +99,11 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
# install Chrome so the correct version of webdriver can be installed by chromedriver when setting up the repo
- name: install Chrome stable
# Pin Chrome version 114.0.5735.90-1 to avoid install failures like "No such object: chromedriver/LATEST_RELEASE_115.0.5790".
# The failure happens because https://chromedriver.chromium.org/downloads only goes up to version 114.
# TODO(b/297380444) Update script to install the latest Chrome and ChromeDriver.
run: |
sudo apt-get update
sudo apt-get install wget
sudo wget http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.90-1_amd64.deb
sudo apt-get install -f ./google-chrome-stable_114.0.5735.90-1_amd64.deb --allow-downgrades
# install Chrome first, so the correct version of webdriver can be installed by chromedriver
# when setting up the repo
- name: install Chrome stable
run: |
npx @puppeteer/browsers install chrome@stable
- name: Download build archive
uses: actions/download-artifact@v3
with:
Expand Down
28 changes: 11 additions & 17 deletions .github/workflows/test-changed-auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,31 @@ on: pull_request
env:
# make chromedriver detect installed Chrome version and download the corresponding driver
DETECT_CHROMEDRIVER_VERSION: true
# The default behavior of chromedriver uses the older Chrome download URLs. We need to override
# the beahvior to use the new URLs.
CHROMEDRIVER_CDNURL: https://googlechromelabs.github.io/
CHROMEDRIVER_CDNBINARIESURL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/

jobs:
test-chrome:
name: Test Auth on Chrome and Node If Changed
runs-on: ubuntu-latest

steps:
# install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo
# install Chrome first, so the correct version of webdriver can be installed by chromedriver
# when setting up the repo
- name: install Chrome stable
# Pin Chrome version 114.0.5735.90-1 to avoid install failures like "No such object: chromedriver/LATEST_RELEASE_115.0.5790".
# The failure happens because https://chromedriver.chromium.org/downloads only goes up to version 114.
# TODO(b/297380444) Update script to install the latest Chrome and ChromeDriver.
run: |
sudo apt-get update
sudo apt-get install wget
sudo wget http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.90-1_amd64.deb
sudo apt-get install -f ./google-chrome-stable_114.0.5735.90-1_amd64.deb --allow-downgrades
npx @puppeteer/browsers install chrome@stable
- 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)
- name: Set up Node (16)
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16.x
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
Expand All @@ -49,27 +48,22 @@ jobs:

runs-on: ubuntu-20.04

# Pin Chrome version 114.0.5735.90-1 to avoid install failures like "No such object: chromedriver/LATEST_RELEASE_115.0.5790".
# The failure happens because https://chromedriver.chromium.org/downloads only goes up to version 114.
# TODO(b/297380444) Update script to install the latest Chrome and ChromeDriver.
steps:
- name: install Firefox stable
run: |
sudo apt-get update
sudo apt-get install firefox
sudo apt-get install wget
sudo wget http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.90-1_amd64.deb
sudo apt-get install -f ./google-chrome-stable_114.0.5735.90-1_amd64.deb --allow-downgrades
- 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)
- name: Set up Node (16)
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16.x
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-changed-fcm-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
with:
# This makes Actions fetch all Git history so run-changed script can diff properly.
fetch-depth: 0
- name: Set up Node (14)
- name: Set up Node (16)
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16.x
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-changed-firestore-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
with:
# This makes Actions fetch all Git history so run-changed script can diff properly.
fetch-depth: 0
- name: Set up Node (14)
- name: Set up Node (16)
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16.x
- name: install Chrome stable
run: |
sudo apt-get update
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/test-changed-firestore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
with:
# This makes Actions fetch all Git history so run-changed script can diff properly.
fetch-depth: 0
- name: Set up Node (14)
- name: Set up Node (16)
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16.x
- name: install Chrome stable
run: |
sudo apt-get update
Expand Down Expand Up @@ -68,10 +68,10 @@ jobs:
needs: build
if: ${{ needs.build.outputs.changed == 'true'}}
steps:
- name: Set up Node (14)
- name: Set up Node (16)
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16.x
- name: install Chrome stable
run: |
sudo apt-get update
Expand All @@ -98,10 +98,10 @@ jobs:
needs: build
if: ${{ needs.build.outputs.changed == 'true'}}
steps:
- name: Set up Node (14)
- name: Set up Node (16)
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16.x
- name: install Chrome stable
run: |
sudo apt-get update
Expand Down Expand Up @@ -132,10 +132,10 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install firefox
- name: Set up Node (14)
- name: Set up Node (16)
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16.x
- name: Download build archive
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -173,10 +173,10 @@ jobs:
name: build.tar.gz
- name: Unzip build artifact
run: tar xf build.tar.gz
- name: Set up Node (14)
- name: Set up Node (16)
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16.x
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-changed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
with:
# This makes Actions fetch all Git history so run-changed script can diff properly.
fetch-depth: 0
- name: Set up Node (14)
- name: Set up Node (16)
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16.x
- name: install Chrome stable
run: |
sudo apt-get update
Expand Down Expand Up @@ -44,10 +44,10 @@ jobs:
uses: actions/checkout@master
with:
fetch-depth: 0
- name: Set up Node (14)
- name: Set up Node (16)
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16.x
- name: install Firefox stable
run: |
sudo apt-get update
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-firebase-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
with:
# This makes Actions fetch all Git history so run-changed script can diff properly.
fetch-depth: 0
- name: Set up Node (14)
- name: Set up Node (16)
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16.x
- name: install Chrome stable
run: |
sudo apt-get update
Expand Down
2 changes: 1 addition & 1 deletion integration/messaging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"devDependencies": {
"firebase": "10.3.1",
"chai": "4.3.7",
"chromedriver": "98.0.1",
"chromedriver": "114.0.2",
"express": "4.18.2",
"geckodriver": "2.0.4",
"mocha": "9.2.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"build:deps": "lerna run --scope @firebase/analytics-compat --include-dependencies build",
"build:release": "yarn build && yarn add-compat-overloads",
"dev": "rollup -c -w",
"test": "run-p lint test:browser",
"test": "run-p --npm-path npm lint test:browser",
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:browser",
"test:browser": "karma start --single-run",
"test:browser:debug": "karma start --browsers=Chrome --auto-watch",
Expand Down
4 changes: 2 additions & 2 deletions packages/analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"build:release": "yarn build && yarn typings:public",
"build:deps": "lerna run --scope @firebase/analytics --include-dependencies build",
"dev": "rollup -c -w",
"test": "run-p lint test:all",
"test:all": "run-p test:browser test:integration",
"test": "run-p --npm-path npm lint test:all",
"test:all": "run-p --npm-path npm test:browser test:integration",
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
"test:browser": "karma start --single-run --nocache",
"test:integration": "karma start ./karma.integration.conf.js --single-run --nocache",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-check-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"build:release": "yarn build && yarn add-compat-overloads",
"build:deps": "lerna run --scope @firebase/app-check-compat --include-dependencies build",
"dev": "rollup -c -w",
"test": "run-p lint test:browser",
"test": "run-p --npm-path npm lint test:browser",
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:browser",
"test:browser": "karma start --single-run --nocache",
"add-compat-overloads": "ts-node-script ../../scripts/build/create-overloads.ts -i ../app-check/dist/app-check-public.d.ts -o dist/src/index.d.ts -a -r AppCheck:FirebaseAppCheck -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/app-check"
Expand Down
2 changes: 1 addition & 1 deletion packages/app-check/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"build:release": "yarn build && yarn api-report && yarn typings:public",
"build:deps": "lerna run --scope @firebase/app-check --include-dependencies build",
"dev": "rollup -c -w",
"test": "run-p lint test:browser",
"test": "run-p --npm-path npm lint test:browser",
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:browser",
"test:browser": "karma start --single-run --nocache",
"api-report": "api-extractor run --local --verbose",
Expand Down
4 changes: 2 additions & 2 deletions packages/app-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"build": "rollup -c && yarn api-report",
"build:deps": "lerna run --scope @firebase/app-compat --include-dependencies build",
"dev": "rollup -c -w",
"test": "run-p lint test:all",
"test:all": "run-p test:browser test:node",
"test": "run-p --npm-path npm lint test:all",
"test:all": "run-p --npm-path npm test:browser test:node",
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
"test:browser": "karma start --single-run",
"test:browser:debug": "karma start --browsers Chrome --auto-watch",
Expand Down
4 changes: 2 additions & 2 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"build:release": "rollup -c rollup.config.release.js && yarn api-report && yarn typings:public",
"build:deps": "lerna run --scope @firebase/app --include-dependencies build",
"dev": "rollup -c -w",
"test": "run-p lint test:all",
"test": "run-p --npm-path npm lint test:all",
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
"test:all": "run-p test:browser test:node",
"test:all": "run-p --npm-path npm test:browser test:node",
"test:browser": "karma start --single-run",
"test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha src/**/*.test.ts --config ../../config/mocharc.node.js",
"api-report": "api-extractor run --local --verbose",
Expand Down
6 changes: 3 additions & 3 deletions packages/auth-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
"build:deps": "lerna run --scope @firebase/auth-compat --include-dependencies build",
"build:release": "yarn build && yarn add-compat-overloads",
"dev": "rollup -c -w",
"test": "run-p lint test:all",
"test:all": "run-p test:browser test:node test:integration",
"test": "run-p --npm-path npm lint test:all",
"test:all": "run-p --npm-path npm test:browser test:node test:integration",
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
"test:browser": "karma start --single-run",
"test:browser:unit": "karma start --single-run --unit",
"test:browser:integration": "karma start --single-run --integration",
"test:node": "ts-node -O '{\"module\": \"commonjs\", \"target\": \"es6\"}' scripts/run_node_tests.ts",
"test:node:integration": "ts-node -O '{\"module\": \"commonjs\", \"target\": \"es6\"}' scripts/run_node_tests.ts --integration",
"test:webdriver": "rollup -c test/integration/webdriver/static/rollup.config.js && ts-node -O '{\"module\": \"commonjs\", \"target\": \"es6\"}' scripts/run_node_tests.ts --webdriver",
"test:integration": "firebase emulators:exec --project demo-emulatedproject --only auth \"run-s test:browser:integration test:node:integration test:webdriver\"",
"test:integration": "firebase emulators:exec --project demo-emulatedproject --only auth \"run-s --npm-path npm test:browser:integration test:node:integration test:webdriver\"",
"add-compat-overloads": "ts-node-script ../../scripts/build/create-overloads.ts -i ../auth/dist/auth-public.d.ts -o dist/auth-compat/index.d.ts -a -r Auth:types.FirebaseAuth -r User:types.User -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/auth"
},
"peerDependencies": {
Expand Down
12 changes: 6 additions & 6 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@
"build:release": "yarn build && yarn typings:public",
"build:scripts": "tsc -moduleResolution node --module commonjs scripts/*.ts && ls scripts/*.js | xargs -I % sh -c 'terser % -o %'",
"dev": "rollup -c -w",
"test": "run-p lint test:all",
"test:all": "run-p test:browser:unit test:node:unit test:integration test:browser:integration:prodbackend",
"test:integration": "firebase emulators:exec --project emulatedproject --only auth \"run-s test:browser:integration:local test:node:integration:local test:webdriver\"",
"test": "run-p --npm-path npm lint test:all",
"test:all": "run-p --npm-path npm test:browser:unit test:node:unit test:integration test:browser:integration:prodbackend",
"test:integration": "firebase emulators:exec --project emulatedproject --only auth \"run-s --npm-path npm test:browser:integration:local test:node:integration:local test:webdriver\"",
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
"test:integration:local": "run-s test:node:integration:local test:browser:integration:local test:webdriver",
"test:integration:local": "run-s --npm-path npm test:node:integration:local test:browser:integration:local test:webdriver",
"test:browser": "karma start --single-run --local",
"test:browser:unit": "karma start --single-run --unit",
"test:browser:integration": "karma start --single-run --integration",
Expand All @@ -92,7 +92,7 @@
"test:browser:unit:debug": "karma start --auto-watch --unit",
"test:cordova": "karma start --single-run --cordova",
"test:cordova:debug": "karma start --auto-watch --cordova",
"test:node": "run-s test:node:unit test:node:integration:local",
"test:node": "run-s --npm-path npm test:node:unit test:node:integration:local",
"test:node:unit": "ts-node -O '{\"module\": \"commonjs\", \"target\": \"es6\"}' scripts/run_node_tests.ts",
"test:node:integration": "ts-node -O '{\"module\": \"commonjs\", \"target\": \"es6\"}' scripts/run_node_tests.ts --integration",
"test:node:integration:local": "ts-node -O '{\"module\": \"commonjs\", \"target\": \"es6\"}' scripts/run_node_tests.ts --integration --local",
Expand Down Expand Up @@ -124,7 +124,7 @@
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-strip": "2.1.0",
"@types/express": "4.17.17",
"chromedriver": "98.0.1",
"chromedriver": "114.0.2",
"rollup": "2.79.1",
"rollup-plugin-sourcemaps": "0.6.3",
"rollup-plugin-typescript2": "0.31.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"build": "rollup -c",
"build:deps": "lerna run --scope @firebase/component --include-dependencies build",
"dev": "rollup -c -w",
"test": "run-p lint test:all",
"test:all": "run-p test:browser test:node",
"test": "run-p --npm-path npm lint test:all",
"test:all": "run-p --npm-path npm test:browser test:node",
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
"test:browser": "karma start --single-run",
"test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha src/**/*.test.ts --config ../../config/mocharc.node.js"
Expand Down
2 changes: 1 addition & 1 deletion packages/database-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"build:release": "yarn build && yarn add-compat-overloads",
"build:deps": "lerna run --scope @firebase/database-compat --include-dependencies build",
"dev": "rollup -c -w",
"test": "run-p lint test:browser test:node",
"test": "run-p --npm-path npm lint test:browser test:node",
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test",
"test:browser": "karma start --single-run",
"test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js",
Expand Down
Loading

0 comments on commit 2be12d7

Please sign in to comment.