angular-cn/scripts/ci-lite/test_e2e.sh
George Kalpakas d1feb478a2 build(integration): fix tests (#14371)
Previously, the `integration/` tests were failing, because `concurrently "foo"`
does not inherit the `PATH` env var ([more info][1]).

This commit fixes it, by setting the `PATH` env var explicitly:
`concurrently "PATH=$PATH foo"`.

This commit also includes some minor refactoring of the `integration/` tests scripts:

- Move build-related operations to `ci-lite/build.sh` (for consistency).
- Use `yarn run ...` instead of `npm run ...` inside package.json scripts.
- Use global `yarn` (since we are already using it for `aio/`).
- Fix some `travis_fold` statements.

[1]: https://github.com/kimmobrunfeldt/concurrently/issues/61#issuecomment-252081610
2017-02-09 09:08:16 -08:00

59 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
set -ex -o pipefail
if [[ ${TRAVIS} && ${CI_MODE} != "e2e" ]]; then
exit 0;
fi
echo 'travis_fold:start:test.e2e'
# Setup environment
cd `dirname $0`
source ./env.sh
cd ../..
echo 'travis_fold:start:test.e2e.buildPackages'
./build.sh
echo 'travis_fold:end:test.e2e.buildPackages'
if [[ ${TRAVIS} ]]; then
echo 'travis_fold:start:test.e2e.localChrome'
sh -e /etc/init.d/xvfb start
echo 'travis_fold:end:test.e2e.localChrome'
fi
echo 'travis_fold:start:test.e2e.integration'
./integration/run_tests.sh
#TODO(alexeagle): move offline_compiler_test to integration/
./scripts/ci-lite/offline_compiler_test.sh
echo 'travis_fold:end:test.e2e.integration'
echo 'travis_fold:start:test.e2e.apiAndCircularDeps'
$(npm bin)/gulp public-api:enforce
$(npm bin)/gulp check-cycle
echo 'travis_fold:end:test.e2e.apiAndCircularDeps'
echo 'travis_fold:start:test.e2e.protractor'
cd dist/
$(npm bin)/gulp serve &
$(npm bin)/gulp serve-examples &
cd ..
NODE_PATH=$NODE_PATH:./dist/all $(npm bin)/protractor ./protractor-e2e.conf.js --bundles=true
NODE_PATH=$NODE_PATH:./dist/all $(npm bin)/protractor ./protractor-examples-e2e.conf.js --bundles=true
NODE_PATH=$NODE_PATH:./dist/all $(npm bin)/protractor ./protractor-perf.conf.js --bundles=true --dryrun
echo 'travis_fold:end:test.e2e.protractor'
echo 'travis_fold:end:test.e2e'
if [[ ${TRAVIS} ]]; then
./scripts/publish/publish-build-artifacts.sh
fi