Skip to content

Commit d1feb47

Browse files
gkalpakmhevery
authored andcommitted
build(integration): fix tests (angular#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
1 parent c211ef9 commit d1feb47

File tree

5 files changed

+36
-18
lines changed

5 files changed

+36
-18
lines changed

integration/hello_world__closure/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"protractor": "file:../../node_modules/protractor"
2424
},
2525
"scripts": {
26-
"test": "ngc && ./bundle.sh && concurrently \"npm run serve\" \"npm run protractor\" --kill-others --success first",
26+
"test": "ngc && ./bundle.sh && concurrently \"PATH=$PATH yarn run serve\" \"PATH=$PATH yarn run protractor\" --kill-others --success first",
2727
"serve": "lite-server -c e2e/browser.config.json",
2828
"preprotractor": "tsc -p e2e",
2929
"protractor": "protractor e2e/protractor.config.js"

integration/run_tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ for testDir in $(ls | grep -v rxjs | grep -v node_modules) ; do
2525
cd $testDir
2626
# Workaround for https://github.com/yarnpkg/yarn/issues/2256
2727
rm -f yarn.lock
28-
../../node_modules/.bin/yarn
29-
../../node_modules/.bin/yarn test || exit 1
28+
yarn
29+
yarn test || exit 1
3030
)
3131
done

scripts/ci-lite/build.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ node dist/tools/@angular/tsc-wrapped/src/main -p modules/@angular/platform-brows
1919
node dist/tools/@angular/tsc-wrapped/src/main -p modules/@angular/router/tsconfig-build.json
2020
node dist/tools/@angular/tsc-wrapped/src/main -p modules/@angular/forms/tsconfig-build.json
2121

22+
if [[ ${CI_MODE} == "e2e" ]]; then
23+
echo 'travis_fold:start:BUILD.integration'
24+
25+
# Build integration
26+
cd "`dirname $0`/../../integration"
27+
./build_rxjs_es6.sh
28+
cd -
29+
30+
echo 'travis_fold:end:BUILD.integration'
31+
fi
32+
2233
if [[ ${CI_MODE} == "aio" ]]; then
2334
echo 'travis_fold:start:BUILD.aio'
2435

scripts/ci-lite/install.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,21 @@ node tools/npm/check-node-modules --purge || npm install
3232
echo 'travis_fold:end:install.node_modules'
3333

3434

35-
if [[ ${TRAVIS} && ${CI_MODE} == "aio" ]]; then
36-
37-
# angular.io: Install version of yarn that we are locked against
38-
echo 'travis_fold:start:install.aio.yarn'
35+
if [[ ${TRAVIS} && (${CI_MODE} == "e2e" || ${CI_MODE} == "aio") ]]; then
36+
# Install version of yarn that we are locked against
37+
echo 'travis_fold:start:install.yarn'
3938
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version "${YARN_VERSION}"
40-
echo 'travis_fold:end:install.aio.yarn'
39+
echo 'travis_fold:end:install.yarn'
40+
fi
4141

4242

43+
if [[ ${TRAVIS} && ${CI_MODE} == "aio" ]]; then
4344
# angular.io: Install all yarn dependencies according to angular.io/yarn.lock
4445
echo 'travis_fold:start:install.aio.node_modules'
4546
cd "`dirname $0`/../../angular.io"
4647
yarn install
4748
cd -
4849
echo 'travis_fold:end:install.aio.node_modules'
49-
5050
fi
5151

5252

scripts/ci-lite/test_e2e.sh

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,51 @@ if [[ ${TRAVIS} && ${CI_MODE} != "e2e" ]]; then
77
fi
88

99

10-
echo 'travis_fold:start:test.js'
10+
echo 'travis_fold:start:test.e2e'
1111

1212
# Setup environment
1313
cd `dirname $0`
1414
source ./env.sh
1515
cd ../..
1616

1717

18-
echo 'travis_fold:start:test.buildPackages'
19-
18+
echo 'travis_fold:start:test.e2e.buildPackages'
2019
./build.sh
20+
echo 'travis_fold:end:test.e2e.buildPackages'
2121

22-
echo 'travis_fold:end:test.buildPackages'
2322

2423
if [[ ${TRAVIS} ]]; then
24+
echo 'travis_fold:start:test.e2e.localChrome'
2525
sh -e /etc/init.d/xvfb start
26+
echo 'travis_fold:end:test.e2e.localChrome'
2627
fi
2728

28-
./integration/build_rxjs_es6.sh
29+
30+
echo 'travis_fold:start:test.e2e.integration'
2931
./integration/run_tests.sh
3032
#TODO(alexeagle): move offline_compiler_test to integration/
3133
./scripts/ci-lite/offline_compiler_test.sh
34+
echo 'travis_fold:end:test.e2e.integration'
3235

33-
$(npm bin)/gulp public-api:enforce
3436

37+
echo 'travis_fold:start:test.e2e.apiAndCircularDeps'
38+
$(npm bin)/gulp public-api:enforce
3539
$(npm bin)/gulp check-cycle
40+
echo 'travis_fold:end:test.e2e.apiAndCircularDeps'
41+
3642

37-
echo 'travis_fold:start:test.e2e.localChrome'
43+
echo 'travis_fold:start:test.e2e.protractor'
3844
cd dist/
3945
$(npm bin)/gulp serve &
4046
$(npm bin)/gulp serve-examples &
4147
cd ..
4248
NODE_PATH=$NODE_PATH:./dist/all $(npm bin)/protractor ./protractor-e2e.conf.js --bundles=true
4349
NODE_PATH=$NODE_PATH:./dist/all $(npm bin)/protractor ./protractor-examples-e2e.conf.js --bundles=true
4450
NODE_PATH=$NODE_PATH:./dist/all $(npm bin)/protractor ./protractor-perf.conf.js --bundles=true --dryrun
45-
echo 'travis_fold:end:test.e2e.localChrome'
51+
echo 'travis_fold:end:test.e2e.protractor'
52+
53+
echo 'travis_fold:end:test.e2e'
4654

47-
echo 'travis_fold:end:test.js'
4855

4956
if [[ ${TRAVIS} ]]; then
5057
./scripts/publish/publish-build-artifacts.sh

0 commit comments

Comments
 (0)