From 04d0f6105cd259381553e69a4a39bc579051af9e Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 19 Aug 2020 08:53:36 -0700 Subject: [PATCH 01/10] fix lint issue --- repo-scripts/changelog-generator/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/repo-scripts/changelog-generator/index.ts b/repo-scripts/changelog-generator/index.ts index d23b90c3aec..1eaf2ca5b43 100644 --- a/repo-scripts/changelog-generator/index.ts +++ b/repo-scripts/changelog-generator/index.ts @@ -30,13 +30,15 @@ const changelogFunctions: ChangelogFunctions = { 'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]' ); } - if (dependenciesUpdated.length === 0) return ''; + if (dependenciesUpdated.length === 0) { + return ''; + } const changesetLink = `- Updated dependencies [${( await Promise.all( changesets.map(async cs => { if (cs.commit) { - let { links } = await getInfo({ + const { links } = await getInfo({ repo: options.repo, commit: cs.commit }); @@ -65,7 +67,7 @@ const changelogFunctions: ChangelogFunctions = { .map(l => l.trimRight()); if (changeset.commit) { - let { pull: pullNumber, links } = await getInfo({ + const { pull: pullNumber, links } = await getInfo({ repo: options.repo, commit: changeset.commit }); From 1669a4364e83b9ac2033dcb10a140534a5e8ba7a Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 19 Aug 2020 09:00:54 -0700 Subject: [PATCH 02/10] add lint workflow --- .github/workflows/lint.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000000..45422454a08 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,19 @@ +name: Lint All Packages + +on: push + +jobs: + test: + name: Lint + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Node (10) + uses: actions/setup-node@v1 + with: + node-version: 10.x + - name: yarn install + run: yarn + - name: yarn lint + run: yarn lint From b7a2a64e9cf8ee1966474db751ef15712978c684 Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 19 Aug 2020 09:15:29 -0700 Subject: [PATCH 03/10] remove type check scripts --- packages/analytics/package.json | 3 +-- packages/app/package.json | 3 +-- packages/component/package.json | 3 +-- packages/functions/package.json | 3 +-- packages/installations/package.json | 3 +-- packages/messaging/package.json | 7 +++---- packages/template/package.json | 3 +-- packages/util/package.json | 3 +-- 8 files changed, 10 insertions(+), 18 deletions(-) diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 88e893134d1..071f716dbb4 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -13,10 +13,9 @@ "build": "rollup -c", "build:deps": "lerna run --scope @firebase/'{app,analytics}' --include-dependencies build", "dev": "rollup -c -w", - "test": "yarn type-check && yarn run-p lint test:browser", + "test": "yarn run-p lint test:browser", "test:ci": "node ../../scripts/run_tests_in_ci.js", "test:browser": "karma start --single-run --nocache", - "type-check": "tsc -p . --noEmit", "prepare": "yarn build" }, "peerDependencies": { diff --git a/packages/app/package.json b/packages/app/package.json index 35e746e8c60..645258dc55b 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -17,9 +17,8 @@ "build": "rollup -c", "build:deps": "lerna run --scope @firebase/app --include-dependencies build", "dev": "rollup -c -w", - "test": "yarn type-check && run-p lint test:browser test:node", + "test": "run-p lint test:browser test:node", "test:ci": "node ../../scripts/run_tests_in_ci.js", - "type-check": "tsc -p . --noEmit", "test:browser": "karma start --single-run", "test:browser:debug": "karma start --browsers Chrome --auto-watch", "test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha test/**/*.test.* --config ../../config/mocharc.node.js", diff --git a/packages/component/package.json b/packages/component/package.json index bfcaccff3e1..b8f217c1f51 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -14,9 +14,8 @@ "build": "rollup -c", "build:deps": "lerna run --scope @firebase/component --include-dependencies build", "dev": "rollup -c -w", - "test": "yarn type-check && run-p lint test:browser test:node", + "test": "run-p lint test:browser test:node", "test:ci": "node ../../scripts/run_tests_in_ci.js", - "type-check": "tsc -p . --noEmit", "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", "prepare": "yarn build" diff --git a/packages/functions/package.json b/packages/functions/package.json index 5bf885cd6f2..20c0f1e0a09 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -14,9 +14,8 @@ "build": "rollup -c", "build:deps": "lerna run --scope @firebase/'{app,functions}' --include-dependencies build", "dev": "rollup -c -w", - "test": "yarn type-check && run-p lint test:browser test:node", + "test": "run-p lint test:browser test:node", "test:ci": "node ../../scripts/run_tests_in_ci.js", - "type-check": "tsc -p . --noEmit", "test:browser": "karma start --single-run", "test:browser:debug": "karma start --browsers=Chrome --auto-watch", "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --file index.node.ts --config ../../config/mocharc.node.js", diff --git a/packages/installations/package.json b/packages/installations/package.json index f8628d1e2f5..ae2f0b4c3d5 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -12,11 +12,10 @@ "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", "build": "rollup -c", "build:deps": "lerna run --scope @firebase/'{app,installations}' --include-dependencies build", - "test": "yarn type-check && yarn test:karma && yarn lint", + "test": "yarn test:karma && yarn lint", "test:ci": "node ../../scripts/run_tests_in_ci.js", "test:karma": "karma start --single-run", "test:debug": "karma start --browsers=Chrome --auto-watch", - "type-check": "tsc -p . --noEmit", "serve": "yarn serve:build && yarn serve:host", "serve:build": "rollup -c test-app/rollup.config.js", "serve:host": "http-server -c-1 test-app", diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 4c9a9548c28..66d8e27ed76 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -13,13 +13,12 @@ "build": "rollup -c", "build:deps": "lerna run --scope @firebase/'{app,messaging}' --include-dependencies build", "dev": "rollup -c -w", - "test": "run-p test:karma type-check lint ", - "test:integration": "run-p test:karma type-check lint && cd ../../integration/messaging && npm run-script test", + "test": "test:karma", + "test:integration": "test:karma && cd ../../integration/messaging && npm run-script test", "test:ci": "node ../../scripts/run_tests_in_ci.js", "test:karma": "karma start --single-run", "test:debug": "karma start --browsers=Chrome --auto-watch", - "prepare": "yarn build", - "type-check": "tsc --noEmit" + "prepare": "yarn build" }, "license": "Apache-2.0", "peerDependencies": { diff --git a/packages/template/package.json b/packages/template/package.json index 1bdd8dce645..c6c021fc942 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -17,11 +17,10 @@ "build": "rollup -c", "build:deps": "lerna run --scope @firebase/'{app,template}' --include-dependencies build", "dev": "rollup -c -w", - "test": "yarn type-check && run-p lint test:browser test:node", + "test": "run-p lint test:browser test:node", "test:ci": "node ../../scripts/run_tests_in_ci.js", "test:browser": "karma start --single-run", "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha src/**/*.test.* --config ../../config/mocharc.node.js", - "type-check": "tsc -p . --noEmit", "prepare": "yarn build" }, "peerDependencies": { diff --git a/packages/util/package.json b/packages/util/package.json index 757fc6a29ea..164cee88743 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -14,9 +14,8 @@ "build": "rollup -c", "build:deps": "lerna run --scope @firebase/util --include-dependencies build", "dev": "rollup -c -w", - "test": "yarn type-check && run-p lint test:browser test:node", + "test": "run-p test:browser test:node", "test:ci": "node ../../scripts/run_tests_in_ci.js", - "type-check": "tsc -p . --noEmit", "test:browser": "karma start --single-run", "test:node": "TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha test/**/*.test.* --config ../../config/mocharc.node.js", "prepare": "yarn build" From c072fb08ed234e6b42344036625d47f38ba6a816 Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 19 Aug 2020 09:58:36 -0700 Subject: [PATCH 04/10] exclude lint from ci:test --- packages-exp/app-exp/package.json | 6 +++--- packages-exp/functions-exp/package.json | 6 +++--- packages/analytics/package.json | 4 ++-- packages/app/package.json | 5 +++-- packages/component/package.json | 5 +++-- packages/database/package.json | 2 +- packages/firestore/package.json | 2 +- packages/functions/package.json | 5 +++-- packages/installations/package.json | 4 ++-- packages/logger/package.json | 5 +++-- packages/messaging/package.json | 4 ++-- packages/performance/package.json | 2 +- packages/remote-config/package.json | 2 +- packages/rules-unit-testing/package.json | 2 +- packages/rxfire/package.json | 2 +- packages/storage/package.json | 2 +- packages/template/package.json | 5 +++-- packages/testing/package.json | 2 +- packages/util/package.json | 5 +++-- repo-scripts/changelog-generator/package.json | 5 ++--- repo-scripts/size-analysis/package.json | 6 +++--- scripts/run_tests_in_ci.js | 20 ++++++++++++++++--- 22 files changed, 60 insertions(+), 41 deletions(-) diff --git a/packages-exp/app-exp/package.json b/packages-exp/app-exp/package.json index 0618df6bf81..e4543ec13db 100644 --- a/packages-exp/app-exp/package.json +++ b/packages-exp/app-exp/package.json @@ -16,11 +16,11 @@ "build:release": "rollup -c rollup.config.release.js && yarn api-report && yarn typings:public", "build:deps": "lerna run --scope @firebase/app-exp --include-dependencies build", "dev": "rollup -c -w", - "test": "yarn type-check && run-p lint test:browser test:node", - "test:ci": "node ../../scripts/run_tests_in_ci.js", + "test": "run-p lint test:all", + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all", + "test:all": "run-p 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", - "type-check": "tsc -p . --noEmit", "prepare": "rollup -c rollup.config.release.js && yarn api-report", "api-report": "api-extractor run --local --verbose", "predoc": "node ../../scripts/exp/remove-exp.js temp", diff --git a/packages-exp/functions-exp/package.json b/packages-exp/functions-exp/package.json index c70fd443b39..8802b5438f7 100644 --- a/packages-exp/functions-exp/package.json +++ b/packages-exp/functions-exp/package.json @@ -16,9 +16,9 @@ "build:deps": "lerna run --scope @firebase/functions-exp --include-dependencies build", "build:release": "rollup -c rollup.config.release.js && yarn api-report", "dev": "rollup -c -w", - "test": "yarn type-check && run-p lint test:browser test:node", - "test:ci": "node ../../scripts/run_tests_in_ci.js", - "type-check": "tsc -p . --noEmit", + "test": "run-p lint test:all", + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all", + "test:all": "run-p test:browser test:node", "test:browser": "karma start --single-run", "test:browser:debug": "karma start --browsers=Chrome --auto-watch", "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'src/{,!(browser)/**/}*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js", diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 071f716dbb4..0cfd7787dab 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -13,8 +13,8 @@ "build": "rollup -c", "build:deps": "lerna run --scope @firebase/'{app,analytics}' --include-dependencies build", "dev": "rollup -c -w", - "test": "yarn run-p lint test:browser", - "test:ci": "node ../../scripts/run_tests_in_ci.js", + "test": "run-p lint test:browser", + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:browser", "test:browser": "karma start --single-run --nocache", "prepare": "yarn build" }, diff --git a/packages/app/package.json b/packages/app/package.json index 645258dc55b..0a1eb86e2bf 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -17,8 +17,9 @@ "build": "rollup -c", "build:deps": "lerna run --scope @firebase/app --include-dependencies build", "dev": "rollup -c -w", - "test": "run-p lint test:browser test:node", - "test:ci": "node ../../scripts/run_tests_in_ci.js", + "test": "run-p lint test:all", + "test:all": "run-p 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", "test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha test/**/*.test.* --config ../../config/mocharc.node.js", diff --git a/packages/component/package.json b/packages/component/package.json index b8f217c1f51..8a67ac48378 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -14,8 +14,9 @@ "build": "rollup -c", "build:deps": "lerna run --scope @firebase/component --include-dependencies build", "dev": "rollup -c -w", - "test": "run-p lint test:browser test:node", - "test:ci": "node ../../scripts/run_tests_in_ci.js", + "test": "run-p lint test:all", + "test:all": "run-p 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", "prepare": "yarn build" diff --git a/packages/database/package.json b/packages/database/package.json index bbef697b955..9eddd4a6083 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -15,7 +15,7 @@ "build:deps": "lerna run --scope @firebase/'{app,database}' --include-dependencies build", "dev": "rollup -c -w", "test": "run-p lint test:emulator", - "test:ci": "node ../../scripts/run_tests_in_ci.js", + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:emulator", "test:all": "run-p lint test:browser test:node", "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 index.node.ts --config ../../config/mocharc.node.js", diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 55dc000af56..5fb522a08b6 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -36,7 +36,7 @@ "test:exp:browser": "karma start --single-run --exp", "test:exp:browser:debug": "karma start --single-run --exp --auto-watch", "test": "run-s lint test:all", - "test:ci": "node ../../scripts/run_tests_in_ci.js", + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all", "test:all": "run-p test:browser test:lite:browser test:exp:browser test:travis test:minified", "test:browser": "karma start --single-run", "test:browser:debug": "karma start --browsers=Chrome --auto-watch", diff --git a/packages/functions/package.json b/packages/functions/package.json index 20c0f1e0a09..92dbe936989 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -14,8 +14,9 @@ "build": "rollup -c", "build:deps": "lerna run --scope @firebase/'{app,functions}' --include-dependencies build", "dev": "rollup -c -w", - "test": "run-p lint test:browser test:node", - "test:ci": "node ../../scripts/run_tests_in_ci.js", + "test": "run-p lint test:all", + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all", + "test:all": "run-p test:browser test:node", "test:browser": "karma start --single-run", "test:browser:debug": "karma start --browsers=Chrome --auto-watch", "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --file index.node.ts --config ../../config/mocharc.node.js", diff --git a/packages/installations/package.json b/packages/installations/package.json index ae2f0b4c3d5..a7b9635c7fc 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -12,8 +12,8 @@ "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", "build": "rollup -c", "build:deps": "lerna run --scope @firebase/'{app,installations}' --include-dependencies build", - "test": "yarn test:karma && yarn lint", - "test:ci": "node ../../scripts/run_tests_in_ci.js", + "test": "run-p lint test:karma", + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:karma", "test:karma": "karma start --single-run", "test:debug": "karma start --browsers=Chrome --auto-watch", "serve": "yarn serve:build && yarn serve:host", diff --git a/packages/logger/package.json b/packages/logger/package.json index 566ce999236..b8e11c31d2e 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -13,8 +13,9 @@ "build": "rollup -c", "build:deps": "lerna run --scope @firebase/logger --include-dependencies build", "dev": "rollup -c -w", - "test": "run-p lint test:browser test:node", - "test:ci": "node ../../scripts/run_tests_in_ci.js", + "test": "run-p lint test:all", + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all", + "test:all": "run-p test:browser test:node", "test:browser": "karma start --single-run", "test:browser:debug": "karma start --browsers Chrome --auto-watch", "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha test/**/*.test.* --config ../../config/mocharc.node.js", diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 66d8e27ed76..395641236fa 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -13,9 +13,9 @@ "build": "rollup -c", "build:deps": "lerna run --scope @firebase/'{app,messaging}' --include-dependencies build", "dev": "rollup -c -w", - "test": "test:karma", + "test": "run-p lint test:karma", "test:integration": "test:karma && cd ../../integration/messaging && npm run-script test", - "test:ci": "node ../../scripts/run_tests_in_ci.js", + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:karma", "test:karma": "karma start --single-run", "test:debug": "karma start --browsers=Chrome --auto-watch", "prepare": "yarn build" diff --git a/packages/performance/package.json b/packages/performance/package.json index 2e5a1dc7111..1e0504a19b0 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -15,7 +15,7 @@ "build:deps": "lerna run --scope @firebase/'{app,performance}' --include-dependencies build", "dev": "rollup -c -w", "test": "run-p lint test:browser", - "test:ci": "node ../../scripts/run_tests_in_ci.js", + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:browser", "test:browser": "karma start --single-run", "test:debug": "karma start --browsers=Chrome --auto-watch", "prepare": "yarn build", diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index 67ce4b215b0..713476efc45 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -15,7 +15,7 @@ "build:deps": "lerna run --scope @firebase/'{app,remote-config}' --include-dependencies build", "dev": "rollup -c -w", "test": "run-p lint test:browser", - "test:ci": "node ../../scripts/run_tests_in_ci.js", + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:browser", "test:browser": "karma start --single-run", "test:debug": "karma start --browsers=Chrome --auto-watch", "prettier": "prettier --write '{src,test}/**/*.{js,ts}'", diff --git a/packages/rules-unit-testing/package.json b/packages/rules-unit-testing/package.json index aec07b80eec..bddc1c2fe84 100644 --- a/packages/rules-unit-testing/package.json +++ b/packages/rules-unit-testing/package.json @@ -16,7 +16,7 @@ "dev": "rollup -c -w", "test:nyc": "TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --config ../../config/mocharc.node.js", "test": "firebase --debug emulators:exec 'yarn test:nyc'", - "test:ci": "node ../../scripts/run_tests_in_ci.js", + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test", "prepare": "yarn build" }, "license": "Apache-2.0", diff --git a/packages/rxfire/package.json b/packages/rxfire/package.json index c94257e7901..77502f664ed 100644 --- a/packages/rxfire/package.json +++ b/packages/rxfire/package.json @@ -28,7 +28,7 @@ "dev": "rollup -c -w", "prepare": "yarn build", "test": "run-p lint test:browser", - "test:ci": "node ../../scripts/run_tests_in_ci.js", + "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" }, diff --git a/packages/storage/package.json b/packages/storage/package.json index 629b199a393..66627b54379 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -14,7 +14,7 @@ "build:deps": "lerna run --scope @firebase/'{app,storage}' --include-dependencies build", "dev": "rollup -c -w", "test": "run-p test:browser lint", - "test:ci": "node ../../scripts/run_tests_in_ci.js", + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:browser", "test:browser:unit": "karma start --single-run --unit", "test:browser:integration": "karma start --single-run --integration", "test:browser": "karma start --single-run", diff --git a/packages/template/package.json b/packages/template/package.json index c6c021fc942..a478b7c092c 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -17,8 +17,9 @@ "build": "rollup -c", "build:deps": "lerna run --scope @firebase/'{app,template}' --include-dependencies build", "dev": "rollup -c -w", - "test": "run-p lint test:browser test:node", - "test:ci": "node ../../scripts/run_tests_in_ci.js", + "test": "run-p lint test:all", + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all", + "test:all": "run-p test:browser test:node", "test:browser": "karma start --single-run", "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha src/**/*.test.* --config ../../config/mocharc.node.js", "prepare": "yarn build" diff --git a/packages/testing/package.json b/packages/testing/package.json index c9b4ad0ba98..2916ce2539f 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -14,7 +14,7 @@ "dev": "rollup -c -w", "test:nyc": "TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --config ../../config/mocharc.node.js", "test": "firebase --debug emulators:exec 'yarn test:nyc'", - "test:ci": "node ../../scripts/run_tests_in_ci.js", + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test", "prepare": "yarn build" }, "license": "Apache-2.0", diff --git a/packages/util/package.json b/packages/util/package.json index 164cee88743..f22ec8111a6 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -14,8 +14,9 @@ "build": "rollup -c", "build:deps": "lerna run --scope @firebase/util --include-dependencies build", "dev": "rollup -c -w", - "test": "run-p test:browser test:node", - "test:ci": "node ../../scripts/run_tests_in_ci.js", + "test": "run-p lint test:all", + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all", + "test:all": "run-p test:browser test:node", "test:browser": "karma start --single-run", "test:node": "TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha test/**/*.test.* --config ../../config/mocharc.node.js", "prepare": "yarn build" diff --git a/repo-scripts/changelog-generator/package.json b/repo-scripts/changelog-generator/package.json index 0de8422f506..08fea8e1412 100644 --- a/repo-scripts/changelog-generator/package.json +++ b/repo-scripts/changelog-generator/package.json @@ -13,9 +13,8 @@ "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", "build": "tsc", "build:dev": "tsc -w", - "test": "yarn type-check", - "prepare": "yarn build", - "type-check": "tsc -p . --noEmit" + "test": "tsc -p . --noEmit", + "prepare": "yarn build" }, "dependencies": { "@changesets/types": "3.1.0", diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index eec2eb34335..e85c824fae6 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -11,9 +11,9 @@ "lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", "pretest": "tsc -p test/test-inputs && rollup -c", - "test": "yarn type-check && TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha **/*.test.ts --config ../../config/mocharc.node.js --timeout 60000", - "test:ci": "node ../../scripts/run_tests_in_ci.js", - "type-check": "tsc -p . --noEmit" + "test": "run-p lint test:node", + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:node", + "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha **/*.test.ts --config ../../config/mocharc.node.js --timeout 60000" }, "dependencies": { "typescript": "3.9.7", diff --git a/scripts/run_tests_in_ci.js b/scripts/run_tests_in_ci.js index 6adb20e4699..afe01772489 100644 --- a/scripts/run_tests_in_ci.js +++ b/scripts/run_tests_in_ci.js @@ -15,19 +15,33 @@ * limitations under the License. */ -const { argv } = require('yargs'); +const yargs = require('yargs'); const path = require('path'); const { spawn } = require('child-process-promise'); +const argv = yargs.options({ + d: { + type: 'string', + desc: 'current working directory', + default: '.' + }, + s: { + type: 'string', + desc: 'the npm script to run', + demandOption: true + } +}).argv; + (async () => { - const myPath = argv._[0] || '.'; // default to the current directory + const myPath = argv.d; + const scriptName = argv.s; const dir = path.resolve(myPath); const { name } = require(`${dir}/package.json`); let stdout = ''; let stderr = ''; try { - const testProcess = spawn('yarn', ['--cwd', dir, 'test']); + const testProcess = spawn('yarn', ['--cwd', dir, scriptName]); testProcess.childProcess.stdout.on('data', data => { stdout += data.toString(); From 03f9b6d2f7a27e60a8319edd509cb6d3a227e859 Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 19 Aug 2020 10:15:18 -0700 Subject: [PATCH 05/10] update test:ci for integration tests --- integration/browserify/package.json | 2 +- integration/firebase-typings/package.json | 2 +- integration/firestore/package.json | 2 +- integration/typescript/package.json | 2 +- integration/webpack/package.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/integration/browserify/package.json b/integration/browserify/package.json index c509cd6f0c3..5771b0776c2 100644 --- a/integration/browserify/package.json +++ b/integration/browserify/package.json @@ -5,7 +5,7 @@ "scripts": { "pretest": "mkdirp dist && browserify src/namespace.test.js -o dist/namespace.test.js", "test": "karma start --single-run", - "test:ci": "node ../../scripts/run_tests_in_ci.js" + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test" }, "devDependencies": { "firebase": "7.18.0", diff --git a/integration/firebase-typings/package.json b/integration/firebase-typings/package.json index 39f896b1156..0adb887f1c5 100644 --- a/integration/firebase-typings/package.json +++ b/integration/firebase-typings/package.json @@ -4,7 +4,7 @@ "version": "0.2.1", "scripts": { "test": "tsc", - "test:ci": "node ../../scripts/run_tests_in_ci.js" + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test" }, "devDependencies": { "firebase": "7.18.0", diff --git a/integration/firestore/package.json b/integration/firestore/package.json index 1d87200a8bf..aa66d258b59 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -7,7 +7,7 @@ "build:persistence": "INCLUDE_FIRESTORE_PERSISTENCE=true gulp compile-tests", "build:memory": "INCLUDE_FIRESTORE_PERSISTENCE=false gulp compile-tests", "test": "yarn build:memory; karma start --single-run; yarn build:persistence; karma start --single-run;", - "test:ci": "node ../../scripts/run_tests_in_ci.js", + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test", "test:persistence": " yarn build:persistence; karma start --single-run", "test:persistence:debug:": "yarn build:persistence; karma start --auto-watch --browsers Chrome", "test:memory": "yarn build:memory; karma start --single-run", diff --git a/integration/typescript/package.json b/integration/typescript/package.json index fae78a79da0..4392b4e162a 100644 --- a/integration/typescript/package.json +++ b/integration/typescript/package.json @@ -4,7 +4,7 @@ "version": "0.2.1", "scripts": { "test": "karma start --single-run", - "test:ci": "node ../../scripts/run_tests_in_ci.js" + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test" }, "devDependencies": { "firebase": "7.18.0", diff --git a/integration/webpack/package.json b/integration/webpack/package.json index 18362cfc35e..14e4ced18fc 100644 --- a/integration/webpack/package.json +++ b/integration/webpack/package.json @@ -5,7 +5,7 @@ "scripts": { "pretest": "webpack", "test": "karma start --single-run", - "test:ci": "node ../../scripts/run_tests_in_ci.js" + "test:ci": "node ../../scripts/run_tests_in_ci.js -s test" }, "devDependencies": { "firebase": "7.18.0", From 8f63a6ae1dce8e7298143029428cdae608541d55 Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 19 Aug 2020 10:36:43 -0700 Subject: [PATCH 06/10] set default script --- scripts/run_tests_in_ci.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run_tests_in_ci.js b/scripts/run_tests_in_ci.js index afe01772489..7272fafd952 100644 --- a/scripts/run_tests_in_ci.js +++ b/scripts/run_tests_in_ci.js @@ -28,7 +28,7 @@ const argv = yargs.options({ s: { type: 'string', desc: 'the npm script to run', - demandOption: true + default: 'test' } }).argv; From f2c76d48f2f5db1376be71172c29db447e2eabd0 Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 19 Aug 2020 11:14:44 -0700 Subject: [PATCH 07/10] remove stream to show time taken for each package --- package.json | 8 ++++---- repo-scripts/size-analysis/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index e860b5dcb60..133387c8225 100644 --- a/package.json +++ b/package.json @@ -31,10 +31,10 @@ "repl": "node tools/repl.js", "release": "ts-node-script scripts/release/cli.ts", "pretest": "node tools/pretest.js", - "test": "lerna run --concurrency 4 --stream test", - "test:ci": "lerna run --concurrency 4 --stream test:ci", - "test:release": "lerna run --concurrency 4 --ignore @firebase/*-exp --ignore firebase-exp --stream test:ci", - "test:exp": "lerna run --concurrency 4 --stream --scope @firebase/*-exp --scope firebase-exp test", + "test": "lerna run --concurrency 4 test", + "test:ci": "lerna run --concurrency 4 --scope @firebase/util --scope @firebase/logger test:ci", + "test:release": "lerna run --concurrency 4 --ignore @firebase/*-exp --ignore firebase-exp test:ci", + "test:exp": "lerna run --concurrency 4 --scope @firebase/*-exp --scope firebase-exp test", "pretest:coverage": "mkdirp coverage", "ci:coverage": "lcov-result-merger 'packages/**/lcov.info' 'lcov-all.info'", "test:coverage": "lcov-result-merger 'packages/**/lcov.info' | coveralls", diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index e85c824fae6..8ce1baead2e 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -10,9 +10,9 @@ "scripts": { "lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", - "pretest": "tsc -p test/test-inputs && rollup -c", "test": "run-p lint test:node", "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:node", + "pretest:node": "tsc -p test/test-inputs && rollup -c", "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha **/*.test.ts --config ../../config/mocharc.node.js --timeout 60000" }, "dependencies": { From 410477f15fd0283e9775dfb24bd3dcfa0234db52 Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 19 Aug 2020 11:32:41 -0700 Subject: [PATCH 08/10] test all pacakges --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 133387c8225..f5dbfc31ceb 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "release": "ts-node-script scripts/release/cli.ts", "pretest": "node tools/pretest.js", "test": "lerna run --concurrency 4 test", - "test:ci": "lerna run --concurrency 4 --scope @firebase/util --scope @firebase/logger test:ci", + "test:ci": "lerna run --concurrency 4 test:ci", "test:release": "lerna run --concurrency 4 --ignore @firebase/*-exp --ignore firebase-exp test:ci", "test:exp": "lerna run --concurrency 4 --scope @firebase/*-exp --scope firebase-exp test", "pretest:coverage": "mkdirp coverage", From b99657231d47ce9d20d9206a2a8cd14382b9521e Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 19 Aug 2020 15:30:03 -0700 Subject: [PATCH 09/10] add stream back for local test --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f5dbfc31ceb..a329f00cd11 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "repl": "node tools/repl.js", "release": "ts-node-script scripts/release/cli.ts", "pretest": "node tools/pretest.js", - "test": "lerna run --concurrency 4 test", + "test": "lerna run --concurrency 4 --stream test", "test:ci": "lerna run --concurrency 4 test:ci", "test:release": "lerna run --concurrency 4 --ignore @firebase/*-exp --ignore firebase-exp test:ci", "test:exp": "lerna run --concurrency 4 --scope @firebase/*-exp --scope firebase-exp test", From 289402ed9f9134b570c11dedcda7c80f392a330d Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Wed, 19 Aug 2020 16:04:02 -0700 Subject: [PATCH 10/10] add stream back --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a329f00cd11..496a57f5bf8 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "test": "lerna run --concurrency 4 --stream test", "test:ci": "lerna run --concurrency 4 test:ci", "test:release": "lerna run --concurrency 4 --ignore @firebase/*-exp --ignore firebase-exp test:ci", - "test:exp": "lerna run --concurrency 4 --scope @firebase/*-exp --scope firebase-exp test", + "test:exp": "lerna run --concurrency 4 --scope @firebase/*-exp --scope firebase-exp --stream test", "pretest:coverage": "mkdirp coverage", "ci:coverage": "lcov-result-merger 'packages/**/lcov.info' 'lcov-all.info'", "test:coverage": "lcov-result-merger 'packages/**/lcov.info' | coveralls",