Skip to content

Commit 0a42e6c

Browse files
Only run circleci tests on the latest branch
1 parent 8875e51 commit 0a42e6c

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

test.sh

+14-11
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,24 @@ test_ci() {
1616
set -e
1717

1818
# This module fails CS jobs currently so this is more informational.
19-
circleci.sh -e CIRCLE_PROJECT_REPONAME=node build --job run-code-sniffer || true
20-
circleci.sh -e CIRCLE_PROJECT_REPONAME=node build --job run-unit-kernel-tests
19+
if [ ! -z $1 ]
20+
then
21+
circleci.sh -e CIRCLE_PROJECT_REPONAME=node build --job run-code-sniffer || true
22+
circleci.sh -e CIRCLE_PROJECT_REPONAME=node build --job run-unit-kernel-tests
2123

22-
circleci.sh -e CIRCLE_PROJECT_REPONAME=node build --job run-behat-tests | tee behat.log
23-
# We need to skip colour codes
24-
egrep "1 scenario \\(.*1 passed" behat.log
24+
circleci.sh -e CIRCLE_PROJECT_REPONAME=node build --job run-behat-tests | tee behat.log
25+
# We need to skip colour codes
26+
egrep "1 scenario \\(.*1 passed" behat.log
2527

26-
# Test that a PHP FATAL error properly fails the job.
27-
git apply ../fixtures/behat-fail.patch
28+
# Test that a PHP FATAL error properly fails the job.
29+
git apply ../fixtures/behat-fail.patch
2830

29-
# circleci doesn't bubble the exit code from behat :(
30-
circleci.sh -e CIRCLE_PROJECT_REPONAME=node build --job run-behat-tests | tee behat.log
31-
grep -A9 'Behat tests failed' behat.log | tail -n 1 | grep '+ exit 1'
31+
# circleci doesn't bubble the exit code from behat :(
32+
circleci.sh -e CIRCLE_PROJECT_REPONAME=node build --job run-behat-tests | tee behat.log
33+
grep -A9 'Behat tests failed' behat.log | tail -n 1 | grep '+ exit 1'
3234

33-
git reset --hard HEAD
35+
git reset --hard HEAD
36+
fi
3437
}
3538

3639
sudo apt-get update -y

0 commit comments

Comments
 (0)