Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 6046bbb

Browse files
committed
chore(scripts): fix test-all script for PRs
1 parent c953da6 commit 6046bbb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

scripts/private/test-all.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ROOT_DIR=`dirname $0`/../..
1313

1414
cd $ROOT_DIR
1515
BRANCH=$(git rev-parse --abbrev-ref HEAD)
16+
COMMIT=$(git rev-parse HEAD)
1617

1718
# Ensure that all the dependencies are there
1819
npm install
@@ -28,7 +29,14 @@ WEBSERVER_PID=$!
2829
# (Steps 0 and 1 do not have tests)
2930
for i in $(seq 2 14)
3031
do
31-
git checkout -f step-$i
32+
if [[ $TRAVIS ]] && [[ "$TRAVIS_REPO_SLUG" == "angular/angular-phonecat" ]] && [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then
33+
# On non-PR builds on CI, use the `step-*` tags.
34+
git checkout -f step-$i
35+
else
36+
# Locally and on PR builds on CI, use the last commits.
37+
# (Assumes that the last commits are the `step-*` commits.)
38+
git checkout -f $COMMIT~$((14 - $i))
39+
fi
3240

3341
node_modules/.bin/karma start karma.conf.js --single-run
3442
node_modules/.bin/protractor e2e-tests/protractor.conf.js --directConnect

0 commit comments

Comments
 (0)