ci(docs-infra): run tests against local Angular packages too (#26202)

PR Close #26202
This commit is contained in:
George Kalpakas 2018-10-05 11:05:47 +03:00 committed by Jason Aden
parent 10e414f617
commit 1b1c8ee545
5 changed files with 53 additions and 13 deletions

View File

@ -49,6 +49,7 @@ env:
- CI_MODE=browserstack_optional
- CI_MODE=aio_tools_test
- CI_MODE=aio
- CI_MODE=aio_local
- CI_MODE=aio_e2e AIO_SHARD=0
- CI_MODE=aio_e2e AIO_SHARD=1

View File

@ -19,27 +19,31 @@ if [[ ${CI_MODE:-} == "bazel" || ${CI_MODE:-} == "docs_test" ]]; then
exit 0;
fi
# Build angular.io, then exit (no Angular build required)
if [[ ${CI_MODE:-} == "aio" ]]; then
# Build the Angular packages
if [[ ${CI_MODE:-} == "aio_local" || ${CI_MODE:-} == "aio_e2e" || ${CI_MODE:-} == "aio_tools_test" ]]; then
travisFoldStart "build.packages.$CI_MODE"
(
./build.sh --examples=false
)
travisFoldEnd "build.packages.$CI_MODE"
# Exit if no further build required
if [[ ${CI_MODE:-} == "aio_e2e" || ${CI_MODE:-} == "aio_tools_test" ]]; then
exit 0;
fi
fi
# Build angular.io, then exit (no further build required)
if [[ ${CI_MODE:-} == "aio" || ${CI_MODE:-} == "aio_local" ]]; then
travisFoldStart "build.aio"
(
cd "`dirname $0`/../../aio"
yarn build
yarn $([[ ${CI_MODE} == "aio" ]] && echo "build" || echo "build-local")
)
travisFoldEnd "build.aio"
exit 0;
fi
# Build the Angular packages then exit (no further build required)
if [[ ${CI_MODE:-} == "aio_e2e" || ${CI_MODE:-} == "aio_tools_test" ]]; then
travisFoldStart "build.$CI_MODE"
(
./build.sh
)
travisFoldEnd "build.$CI_MODE"
exit 0;
fi
travisFoldStart "tsc tools"
$(npm bin)/tsc -p tools
$(npm bin)/tsc -p packages/compiler/tsconfig-tools.json

View File

@ -49,6 +49,7 @@ travisFoldEnd "bower-install"
if [[ ${TRAVIS} &&
${CI_MODE} == "aio" ||
${CI_MODE} == "aio_local" ||
${CI_MODE} == "aio_e2e" ||
${CI_MODE} == "aio_tools_test"
]]; then
@ -67,6 +68,7 @@ if [[ ${TRAVIS} &&
${CI_MODE} == "e2e" ||
${CI_MODE} == "e2e_2" ||
${CI_MODE} == "aio" ||
${CI_MODE} == "aio_local" ||
${CI_MODE} == "aio_e2e"
]]; then
travisFoldStart "install-chromium"

30
scripts/ci/test-aio-local.sh Executable file
View File

@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -u -e -o pipefail
# Setup environment
readonly thisDir=$(cd $(dirname $0); pwd)
source ${thisDir}/_travis-fold.sh
# run in subshell to avoid polluting cwd
(
cd ${PROJECT_ROOT}/aio
# Run PWA-score tests
# (Run before unit and e2e tests, which destroy the `dist/` directory.)
travisFoldStart "test.aio.pwaScore"
yarn test-pwa-score-localhost $AIO_MIN_PWA_SCORE
travisFoldEnd "test.aio.pwaScore"
# Run unit tests
travisFoldStart "test.aio.unit"
yarn test --watch=false
travisFoldEnd "test.aio.unit"
# Run e2e tests
travisFoldStart "test.aio.e2e"
yarn e2e
travisFoldEnd "test.aio.e2e"
)

View File

@ -40,6 +40,9 @@ case ${CI_MODE} in
aio)
${thisDir}/test-aio.sh
;;
aio_local)
${thisDir}/test-aio-local.sh
;;
aio_e2e)
${thisDir}/test-aio-e2e.sh
;;