Skip to content

Commit 92c0d16

Browse files
committed
Merge remote-tracking branch 'origin/master' into update-or-query-tests
2 parents 5d1e3a4 + 3492066 commit 92c0d16

File tree

279 files changed

+15641
-7234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

279 files changed

+15641
-7234
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#######################################################################################################
99

1010
# These owners will be the default owners for everything in the repo.
11-
* @dwyfrequency @hsubox76 @firebase/jssdk-global-approvers
11+
* @firebase/jssdk-global-approvers
1212

1313
# Database Code
1414
packages/database @maneesht @jsdt @jmwski @firebase/jssdk-global-approvers
@@ -74,4 +74,4 @@ scripts/docgen/content-sources/ @egilmorez @firebase/jssdk-global-approvers
7474
docs-devsite/ @egilmorez @markarndt @kevinthecheung
7575

7676
# Changeset
77-
.changeset @firebase/jssdk-changeset-approvers @firebase/firestore-js-team @firebase/jssdk-global-approvers
77+
.changeset @firebase/jssdk-changeset-approvers @firebase/firestore-js-team @firebase/jssdk-global-approvers

.github/workflows/canary-deploy.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,15 @@ jobs:
7676
NPM_TOKEN_APP_CHECK_COMPAT: ${{ secrets.NPM_TOKEN_APP_CHECK_COMPAT }}
7777
NPM_TOKEN_API_DOCUMENTER: ${{ secrets.NPM_TOKEN_API_DOCUMENTER }}
7878
CI: true
79+
- name: Launch E2E tests workflow
80+
# Trigger e2e-test.yml
81+
run: |
82+
VERSION_SCRIPT="const pkg = require('./packages/firebase/package.json'); console.log(pkg.version);"
83+
VERSION_OR_TAG=`node -e "${VERSION_SCRIPT}"`
84+
OSS_BOT_GITHUB_TOKEN=${{ secrets.OSS_BOT_GITHUB_TOKEN }}
85+
curl -X POST \
86+
-H "Content-Type:application/json" \
87+
-H "Accept:application/vnd.github.v3+json" \
88+
-H "Authorization:Bearer $OSS_BOT_GITHUB_TOKEN" \
89+
-d "{\"event_type\":\"canary-tests\", \"client_payload\":{\"versionOrTag\":\"$VERSION_OR_TAG\"}}" \
90+
https://api.github.com/repos/firebase/firebase-js-sdk/dispatches

.github/workflows/e2e-test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: E2E Smoke Tests
33
# Allows REST trigger. Currently triggered by release-cli script during a staging run.
44
on:
55
repository_dispatch:
6-
types: [staging-tests]
6+
types: [staging-tests,canary-tests]
77

88
jobs:
99
test:
@@ -62,6 +62,8 @@ jobs:
6262
- name: Tests succeeded
6363
if: success()
6464
run: node scripts/ci/notify-test-result.js success
65+
# we don't want THIS step erroring to trigger the failure notification
66+
continue-on-error: true
6567
env:
6668
WEBHOOK_URL: ${{ secrets.JSCORE_CHAT_WEBHOOK_URL }}
6769
RELEASE_TRACKER_URL: ${{ secrets.RELEASE_TRACKER_URL }}

.github/workflows/test-all.yml

Lines changed: 173 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ on:
77
env:
88
# make chromedriver detect installed Chrome version and download the corresponding driver
99
DETECT_CHROMEDRIVER_VERSION: true
10+
# The default behavior of chromedriver uses the older Chrome download URLs. We need to override
11+
# the beahvior to use the new URLs.
12+
CHROMEDRIVER_CDNURL: https://googlechromelabs.github.io/
13+
CHROMEDRIVER_CDNBINARIESURL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/
14+
artifactRetentionDays: 14
1015

1116
jobs:
12-
test:
13-
name: Node.js and Browser (Chrome) Tests
17+
build:
18+
name: Build the SDK
1419
runs-on: ubuntu-latest
15-
1620
steps:
17-
# install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo
21+
# Install Chrome so the correct version of webdriver can be installed by chromedriver when
22+
# setting up the repo. This must be done to build and execute Auth properly.
1823
- name: install Chrome stable
19-
# Install Chrome version 110.0.5481.177-1 as some Auth tests start to fail on version 111.
20-
# Temporary: Auth team will explore what's going wrong with the auth tests.
2124
run: |
22-
sudo apt-get update
23-
sudo apt-get install wget
24-
sudo wget http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_110.0.5481.177-1_amd64.deb
25-
sudo apt-get install -f ./google-chrome-stable_110.0.5481.177-1_amd64.deb --allow-downgrades
25+
npx @puppeteer/browsers install chrome@stable
2626
- uses: actions/checkout@v3
2727
- name: Set up Node (16)
2828
uses: actions/setup-node@v3
@@ -36,11 +36,95 @@ jobs:
3636
yarn
3737
- name: yarn build
3838
run: yarn build
39+
- name: Archive build
40+
if: ${{ !cancelled() }}
41+
run: |
42+
tar -cf build.tar .
43+
gzip build.tar
44+
- name: Upload build archive
45+
if: ${{ !cancelled() }}
46+
uses: actions/upload-artifact@v3
47+
with:
48+
name: build.tar.gz
49+
path: build.tar.gz
50+
retention-days: ${{ env.artifactRetentionDays }}
51+
52+
# Auth and Firestore are built and executed in their own jobs in an attempt to reduce flakiness.
53+
test-the-rest:
54+
name: (bulk) Node.js and Browser (Chrome) Tests
55+
needs: build
56+
runs-on: ubuntu-latest
57+
steps:
58+
# install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo
59+
- name: install Chrome stable
60+
run: |
61+
sudo apt-get update
62+
sudo apt-get install google-chrome-stable
63+
- name: Download build archive
64+
uses: actions/download-artifact@v3
65+
with:
66+
name: build.tar.gz
67+
- name: Unzip build artifact
68+
run: tar xf build.tar.gz
69+
- name: Set up Node (16)
70+
uses: actions/setup-node@v3
71+
with:
72+
node-version: 16.x
73+
- name: Bump Node memory limit
74+
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
75+
- name: Test setup and yarn install
76+
run: |
77+
cp config/ci.config.json config/project.json
78+
yarn
79+
- name: Set start timestamp env var
80+
run: echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV
81+
- name: Run unit tests
82+
# Ignore auth and firestore since they're handled in their own separate jobs.
83+
run: |
84+
xvfb-run yarn lerna run --ignore '{firebase-messaging-integration-test,@firebase/auth*,@firebase/firestore*,firebase-firestore-integration-test}' --concurrency 4 test:ci
85+
node scripts/print_test_logs.js
86+
env:
87+
FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
88+
- name: Generate coverage file
89+
run: yarn ci:coverage
90+
- name: Run coverage
91+
uses: coverallsapp/github-action@master
92+
with:
93+
github-token: ${{ secrets.GITHUB_TOKEN }}
94+
path-to-lcov: ./lcov-all.info
95+
continue-on-error: true
96+
97+
test-auth:
98+
name: (Auth) Node.js and Browser (Chrome) Tests
99+
needs: build
100+
runs-on: ubuntu-latest
101+
steps:
102+
# install Chrome first, so the correct version of webdriver can be installed by chromedriver
103+
# when setting up the repo
104+
- name: install Chrome stable
105+
run: |
106+
npx @puppeteer/browsers install chrome@stable
107+
- name: Download build archive
108+
uses: actions/download-artifact@v3
109+
with:
110+
name: build.tar.gz
111+
- name: Unzip build artifact
112+
run: tar xf build.tar.gz
113+
- name: Set up Node (16)
114+
uses: actions/setup-node@v3
115+
with:
116+
node-version: 16.x
117+
- name: Bump Node memory limit
118+
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
119+
- name: Test setup and yarn install
120+
run: |
121+
cp config/ci.config.json config/project.json
122+
yarn
39123
- name: Set start timestamp env var
40124
run: echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV
41125
- name: Run unit tests
42126
run: |
43-
xvfb-run yarn test:ci
127+
xvfb-run yarn lerna run --concurrency 4 test:ci --scope '@firebase/auth*'
44128
node scripts/print_test_logs.js
45129
env:
46130
FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
@@ -52,3 +136,81 @@ jobs:
52136
github-token: ${{ secrets.GITHUB_TOKEN }}
53137
path-to-lcov: ./lcov-all.info
54138
continue-on-error: true
139+
140+
test-firestore:
141+
name: (Firestore) Node.js and Browser (Chrome) Tests
142+
needs: build
143+
runs-on: ubuntu-latest
144+
steps:
145+
# install Chrome so the correct version of webdriver can be installed by chromedriver when setting up the repo
146+
- name: install Chrome stable
147+
run: |
148+
sudo apt-get update
149+
sudo apt-get install google-chrome-stable
150+
- name: Download build archive
151+
uses: actions/download-artifact@v3
152+
with:
153+
name: build.tar.gz
154+
- name: Unzip build artifact
155+
run: tar xf build.tar.gz
156+
- name: Set up Node (16)
157+
uses: actions/setup-node@v3
158+
with:
159+
node-version: 16.x
160+
- name: Bump Node memory limit
161+
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
162+
- name: Test setup and yarn install
163+
run: |
164+
cp config/ci.config.json config/project.json
165+
yarn
166+
- name: Set start timestamp env var
167+
run: echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV
168+
- name: Run unit tests
169+
run: |
170+
xvfb-run yarn lerna run --concurrency 4 test:ci --scope '@firebase/firestore*'
171+
node scripts/print_test_logs.js
172+
env:
173+
FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
174+
- name: Generate coverage file
175+
run: yarn ci:coverage
176+
- name: Run coverage
177+
uses: coverallsapp/github-action@master
178+
with:
179+
github-token: ${{ secrets.GITHUB_TOKEN }}
180+
path-to-lcov: ./lcov-all.info
181+
continue-on-error: true
182+
183+
test-firestore-integration:
184+
strategy:
185+
fail-fast: false
186+
matrix:
187+
persistence: ['memory', 'persistence']
188+
name: Firestore Integration Tests (${{ matrix.persistence }})
189+
needs: build
190+
runs-on: ubuntu-latest
191+
steps:
192+
# install Chrome so the correct version of webdriver can be installed by chromedriver when setting up the repo
193+
- name: install Chrome stable
194+
run: |
195+
sudo apt-get update
196+
sudo apt-get install google-chrome-stable
197+
- name: Download build archive
198+
uses: actions/download-artifact@v3
199+
with:
200+
name: build.tar.gz
201+
- name: Unzip build artifact
202+
run: tar xf build.tar.gz
203+
- name: Set up Node (16)
204+
uses: actions/setup-node@v3
205+
with:
206+
node-version: 16.x
207+
- name: Bump Node memory limit
208+
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
209+
- run: cp config/ci.config.json config/project.json
210+
- run: yarn
211+
- run: yarn build:${{ matrix.persistence }}
212+
working-directory: integration/firestore
213+
- run: xvfb-run yarn karma:singlerun
214+
working-directory: integration/firestore
215+
env:
216+
FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}

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

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,31 @@ on: pull_request
55
env:
66
# make chromedriver detect installed Chrome version and download the corresponding driver
77
DETECT_CHROMEDRIVER_VERSION: true
8+
# The default behavior of chromedriver uses the older Chrome download URLs. We need to override
9+
# the beahvior to use the new URLs.
10+
CHROMEDRIVER_CDNURL: https://googlechromelabs.github.io/
11+
CHROMEDRIVER_CDNBINARIESURL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/
812

913
jobs:
1014
test-chrome:
1115
name: Test Auth on Chrome and Node If Changed
1216
runs-on: ubuntu-latest
1317

1418
steps:
15-
# install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo
19+
# install Chrome first, so the correct version of webdriver can be installed by chromedriver
20+
# when setting up the repo
1621
- name: install Chrome stable
17-
# Install Chrome version 110.0.5481.177-1 as test starts to fail on version 111.
18-
# Temporary: Auth team will explore what's going wrong with the auth tests.
1922
run: |
20-
sudo apt-get update
21-
sudo apt-get install wget
22-
sudo wget http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_110.0.5481.177-1_amd64.deb
23-
sudo apt-get install -f ./google-chrome-stable_110.0.5481.177-1_amd64.deb --allow-downgrades
23+
npx @puppeteer/browsers install chrome@stable
2424
- name: Checkout Repo
2525
uses: actions/checkout@master
2626
with:
2727
# This makes Actions fetch all Git history so run-changed script can diff properly.
2828
fetch-depth: 0
29-
- name: Set up Node (14)
29+
- name: Set up Node (16)
3030
uses: actions/setup-node@v3
3131
with:
32-
node-version: 14.x
32+
node-version: 16.x
3333
- name: Bump Node memory limit
3434
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
3535
- name: Test setup and yarn install
@@ -45,22 +45,25 @@ jobs:
4545
# Whatever version of Firefox comes with 22.04 is causing Firefox
4646
# startup to hang when launched by karma. Need to look further into
4747
# why.
48+
4849
runs-on: ubuntu-20.04
4950

5051
steps:
5152
- name: install Firefox stable
5253
run: |
5354
sudo apt-get update
5455
sudo apt-get install firefox
56+
sudo apt-get install wget
57+
5558
- name: Checkout Repo
5659
uses: actions/checkout@master
5760
with:
5861
# This makes Actions fetch all Git history so run-changed script can diff properly.
5962
fetch-depth: 0
60-
- name: Set up Node (14)
63+
- name: Set up Node (16)
6164
uses: actions/setup-node@v3
6265
with:
63-
node-version: 14.x
66+
node-version: 16.x
6467
- name: Bump Node memory limit
6568
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
6669
- name: Test setup and yarn install

.github/workflows/test-changed-fcm-integration.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
with:
2323
# This makes Actions fetch all Git history so run-changed script can diff properly.
2424
fetch-depth: 0
25-
- name: Set up Node (14)
25+
- name: Set up Node (16)
2626
uses: actions/setup-node@v3
2727
with:
28-
node-version: 14.x
28+
node-version: 16.x
2929
- name: Bump Node memory limit
3030
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
3131
- name: Test setup and yarn install

.github/workflows/test-changed-firestore-integration.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
with:
1414
# This makes Actions fetch all Git history so run-changed script can diff properly.
1515
fetch-depth: 0
16-
- name: Set up Node (14)
16+
- name: Set up Node (16)
1717
uses: actions/setup-node@v3
1818
with:
19-
node-version: 14.x
19+
node-version: 16.x
2020
- name: install Chrome stable
2121
run: |
2222
sudo apt-get update

0 commit comments

Comments
 (0)