From 5af4c2290d3f91d39cdafb65100f5974777b8e45 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Fri, 14 Jun 2019 00:25:35 +0300 Subject: [PATCH 1/3] ci(docs-infra): run PWA score tests after unit/e2e tests Previously, we run the PWA score tests before unit/e2e tests, because the latter would destroy the `dist/` directory required by the former. Since cli@6, unit/e2e tests no longer detroy the `dist/` directory, so it is now safe to run the unit/e2e tests first. This is preferrable, since they are conceptually lower-level and any error messages (in case of breakage) are more specific/actionable. Related discussion about cli behavior: - angular/angular-cli#4366 - angular/angular-cli#14701 --- .circleci/config.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 682bc0c2e6958..def9dd5e8c9c0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -250,16 +250,14 @@ jobs: - run: yarn --cwd aio build --progress=false # Lint the code - run: yarn --cwd aio lint - # Run PWA-score tests - # (Run before unit and e2e tests, which destroy the `dist/` directory.) - - run: yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE - # Check the bundle sizes. - # (Run before unit and e2e tests, which destroy the `dist/` directory.) - - run: yarn --cwd aio payload-size # Run unit tests - run: yarn --cwd aio test --progress=false --watch=false # Run e2e tests - run: yarn --cwd aio e2e --configuration=ci + # Run PWA-score tests + - run: yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE + # Check the bundle sizes. + - run: yarn --cwd aio payload-size # Run unit tests for Firebase redirects - run: yarn --cwd aio redirects-test @@ -285,13 +283,12 @@ jobs: - *init_environment # Build aio (with local Angular packages) - run: yarn --cwd aio build-local --progress=false - # Run PWA-score tests - # (Run before unit and e2e tests, which destroy the `dist/` directory.) - - run: yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE # Run unit tests - run: yarn --cwd aio test --progress=false --watch=false # Run e2e tests - run: yarn --cwd aio e2e --configuration=ci + # Run PWA-score tests + - run: yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE test_aio_local_ivy: <<: *job_defaults @@ -303,13 +300,12 @@ jobs: - *init_environment # Build aio with Ivy (using local Angular packages) - run: yarn --cwd aio build-with-ivy --progress=false - # Run PWA-score tests - # (Run before unit and e2e tests, which destroy the `dist/` directory.) - - run: yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE # Run unit tests - run: yarn --cwd aio test --progress=false --watch=false # Run e2e tests - run: yarn --cwd aio e2e --configuration=ci + # Run PWA-score tests + - run: yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE test_aio_tools: <<: *job_defaults From 9984cc7c3bc83f0772c79a1652e5d9d736ca1f5f Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Fri, 14 Jun 2019 13:01:37 +0300 Subject: [PATCH 2/3] ci(docs-infra): check and track payload sizes for `test_aio_local` and `test_aio_local_ivy` --- .circleci/config.yml | 4 ++++ aio/scripts/_payload-limits.json | 23 +++++++++++++++++++++++ aio/scripts/payload.sh | 4 ++-- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index def9dd5e8c9c0..9c2334e6e1529 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -289,6 +289,8 @@ jobs: - run: yarn --cwd aio e2e --configuration=ci # Run PWA-score tests - run: yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE + # Check the bundle sizes. + - run: yarn --cwd aio payload-size aio-local test_aio_local_ivy: <<: *job_defaults @@ -306,6 +308,8 @@ jobs: - run: yarn --cwd aio e2e --configuration=ci # Run PWA-score tests - run: yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE + # Check the bundle sizes. + - run: yarn --cwd aio payload-size aio-local-ivy test_aio_tools: <<: *job_defaults diff --git a/aio/scripts/_payload-limits.json b/aio/scripts/_payload-limits.json index 9dc6b8b6fb2b0..65cdce12e4300 100755 --- a/aio/scripts/_payload-limits.json +++ b/aio/scripts/_payload-limits.json @@ -10,5 +10,28 @@ "polyfills-es2015": 53295 } } + }, + "aio-local": { + "master": { + "uncompressed": { + "runtime-es5": 3005, + "runtime-es2015": 3011, + "main-es5": 511054, + "main-es2015": 450560, + "polyfills-es5": 129161, + "polyfills-es2015": 53295 + } + } + }, + "aio-local-ivy": { + "master": { + "uncompressed": { + "runtime-es5": 2895, + "runtime-es2015": 2901, + "main-es5": 564586, + "main-es2015": 582731, + "polyfills-es5": 129161, + "polyfills-es2015": 53295 + } } } diff --git a/aio/scripts/payload.sh b/aio/scripts/payload.sh index 0ab4b73fb91de..72ee70a636182 100755 --- a/aio/scripts/payload.sh +++ b/aio/scripts/payload.sh @@ -4,6 +4,7 @@ set -eu -o pipefail readonly thisDir=$(cd $(dirname $0); pwd) readonly parentDir=$(dirname $thisDir) +readonly target=${1:-aio} # Track payload size functions source ../scripts/ci/payload-size.sh @@ -11,5 +12,4 @@ source ../scripts/ci/payload-size.sh # Provide node_modules from aio NODE_MODULES_BIN=$PROJECT_ROOT/aio/node_modules/.bin/ -trackPayloadSize "aio" "dist/*.js" true true "${thisDir}/_payload-limits.json" - +trackPayloadSize "$target" "dist/*.js" true true "${thisDir}/_payload-limits.json" From 501769de8c752aa2bdc29b106d3b74cae38fcc96 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Fri, 14 Jun 2019 14:46:50 +0300 Subject: [PATCH 3/3] fixup! ci(docs-infra): check and track payload sizes for `test_aio_local` and `test_aio_local_ivy` --- aio/scripts/_payload-limits.json | 1 + 1 file changed, 1 insertion(+) diff --git a/aio/scripts/_payload-limits.json b/aio/scripts/_payload-limits.json index 65cdce12e4300..cebe49cf8517f 100755 --- a/aio/scripts/_payload-limits.json +++ b/aio/scripts/_payload-limits.json @@ -32,6 +32,7 @@ "main-es2015": 582731, "polyfills-es5": 129161, "polyfills-es2015": 53295 + } } } }