Skip to content

Commit 8c1e57f

Browse files
committed
Change to running all cci flow tests on an open PR so the coverage
information is correct. Allow use of tokens in commit messages to skip CumulusCI-Test on master or feature branches with an open PR and run CumulusCI-Test on a feature branch without an open PR
1 parent 69f4345 commit 8c1e57f

File tree

1 file changed

+27
-10
lines changed

1 file changed

+27
-10
lines changed

heroku_ci.sh

+27-10
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,31 @@ mv CumulusCI/.git .
1111
# Run the CumulusCI Unit Tests
1212
nosetests --with-tap --tap-stream --with-coverage --cover-package=cumulusci
1313

14+
# If the last commit message contains [skip CumulusCI-Test], skip running any test flows
15+
git log -n 1 | grep '\[skip CumulusCI-Test\]' > /dev/null
16+
exit_status=$?
17+
if [ "$exit_status" == "0" ]; then
18+
echo "Found [skip CumulusCI-Test] in the commit message, skipping cci flow test runs"
19+
coveralls
20+
exit
21+
22+
fi
23+
24+
# For feature branches, skip running the CumulusCI-Test flows if there is not an open PR unless the last commit message contains [run CumulusCI-Test]
25+
if [ "$HEROKU_TEST_RUN_BRANCH" != "master" ] &&\
26+
[[ "$HEROKU_TEST_RUN_BRANCH" == feature/* ]]; then
27+
echo "Checking for open pull request to determine next testing steps"
28+
pr=`python scripts/has_open_pr.py "$HEROKU_TEST_RUN_BRANCH"`
29+
git log -n 1 | grep '\[run CumulusCI-Test\]' > /dev/null
30+
exit_status=$?
31+
if [ "$pr" == ""] && [ "$exit_status" != "0"]; then
32+
# If there is not an open PR, don't run the CumulusCI-Test flows
33+
coveralls
34+
exit
35+
fi
36+
fi
37+
38+
1439
# Clone the CumulusCI-Test repo to run test builds against it with cci
1540
echo "------------------------------------------"
1641
echo "Running test builds against CumulusCI-Test"
@@ -19,7 +44,8 @@ echo ""
1944
echo "Cloning https://github.com/SalesforceFoundation/CumulusCI-Test"
2045
git clone https://github.com/SalesforceFoundation/CumulusCI-Test
2146
cd CumulusCI-Test
22-
if [ $HEROKU_TEST_RUN_BRANCH == "master" ]; then
47+
if [ "$HEROKU_TEST_RUN_BRANCH" == "master" ] ||\
48+
[[ "$HEROKU_TEST_RUN_BRANCH" == feature/* ]] ; then
2349
echo "1...4"
2450
coverage run --append --source=../cumulusci `which cci` flow run ci_feature --org scratch --delete-org | tee cci.log
2551
exit_status=$?
@@ -51,15 +77,6 @@ if [ $HEROKU_TEST_RUN_BRANCH == "master" ]; then
5177
echo "not ok 4 - Failed ci_beta: `tail -1 cci.log`"
5278
fi
5379

54-
else
55-
echo "1...1"
56-
coverage run --append --source=../cumulusci `which cci` flow run ci_feature --org scratch --delete-org
57-
exit_status=$?
58-
if [ "$exit_status" == "0" ]; then
59-
echo "ok 1 - Successfully ran ci_feature"
60-
else
61-
echo "not ok 1 - Failed ci_feature: `tail -1 cci.log`"
62-
fi
6380
fi
6481

6582
# Combine the CumulusCI-Test test coverage with the nosetest coverage

0 commit comments

Comments
 (0)