Skip to content

Commit eb55e6f

Browse files
committed
create a separate workflow for FCM integration tests
1 parent e37e7ad commit eb55e6f

File tree

4 files changed

+62
-1
lines changed

4 files changed

+62
-1
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Test FCM integration
2+
3+
on: pull_request
4+
5+
jobs:
6+
test:
7+
name: Test FCM integration
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout Repo
12+
uses: actions/checkout@master
13+
with:
14+
# This makes Actions fetch all Git history so run-changed script can diff properly.
15+
fetch-depth: 0
16+
- name: Set up Node (10)
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: 10.x
20+
- name: install Chrome stable
21+
run: |
22+
sudo apt-get update
23+
sudo apt-get install google-chrome-stable
24+
- name: Test setup and yarn install
25+
run: |
26+
cp config/ci.config.json config/project.json
27+
yarn
28+
- name: yarn build
29+
run: yarn build
30+
- name: Run tests if FCM or its dependenceies has changed
31+
run: xvfb-run yarn test:changed:fcm

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ jobs:
2727
yarn
2828
- name: yarn build
2929
run: yarn build
30-
- name: Run tests on changed packages
30+
- name: Run tests if firestore or its dependenceies has changed
3131
run: xvfb-run yarn test:changed:firestore

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"test:coverage": "lcov-result-merger 'packages/**/lcov.info' | coveralls",
4141
"test:changed": "ts-node-script scripts/ci-test/run_changed_no_firestore.ts",
4242
"test:changed:firestore": "ts-node-script scripts/ci-test/run_changed_firestore.ts",
43+
"test:changed:fcm": "ts-node-script scripts/ci-test/run_changed_fcm_integration.ts",
4344
"test:setup": "node tools/config.js",
4445
"test:saucelabs": "node scripts/run_saucelabs.js",
4546
"docgen:js": "node scripts/docgen/generate-docs.js --api js",
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* @license
3+
* Copyright 2020 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
import { getTestTasks, runTests } from './run_changed';
19+
20+
const includeOnlyPackages = ['firebase-messaging-integration-test'];
21+
22+
async function run() {
23+
let testTasks = await getTestTasks();
24+
testTasks = testTasks.filter(t => includeOnlyPackages.includes(t.pkgName));
25+
26+
runTests(testTasks);
27+
}
28+
29+
run();

0 commit comments

Comments
 (0)