angular-cn/scripts/ci/test-aio.sh
George Kalpakas 65d57a07e0 build(aio): avoid building before running the local PWA tests
When this command is run on CI, `yarn build` has already been run, so
this was unnecessarily building angular.io again (adding ~4mins to the
`aio` job).
When this command is run locally, it is most often about testing a new
`lighthouse` version/config, so you don't need to build angular.io over
and over (and if necessary, one can always run `yarn build` manually).

Closes #19633
2017-11-02 16:02:52 -07:00

45 lines
906 B
Bash
Executable File

#!/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
# Lint the code
travisFoldStart "test.aio.lint"
yarn lint
travisFoldEnd "test.aio.lint"
# Run PWA-score tests
# (Run before unit and e2e tests, which destroy the `dist/` directory.)
travisFoldStart "test.aio.pwaScore"
yarn test-pwa-score-localhost
travisFoldEnd "test.aio.pwaScore"
# Run unit tests
travisFoldStart "test.aio.unit"
yarn test --single-run
travisFoldEnd "test.aio.unit"
# Run e2e tests
travisFoldStart "test.aio.e2e"
yarn e2e
travisFoldEnd "test.aio.e2e"
# Run unit tests for aio/aio-builds-setup
travisFoldStart "test.aio.aio-builds-setup"
./aio-builds-setup/scripts/test.sh
travisFoldEnd "test.aio.aio-builds-setup"
)