-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtravis_test.sh
More file actions
executable file
·37 lines (30 loc) · 1.11 KB
/
travis_test.sh
File metadata and controls
executable file
·37 lines (30 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
LOCAL_BRANCH_UNDER_TEST="commit_under_test"
SCHEMA_PROJECT="subprojects/demo_schema"
APP_PROJECT="subprojects/demo_schema"
echo "Testing ${TRAVIS_BRANCH} at ${TRAVIS_COMMIT}"
echo "TRAVIS_BUILD_DIR is ${TRAVIS_BUILD_DIR}"
# Run all tests at head, including the check for simultaneous changes
# to both schema and app projects. Abort if build fails.
./gradlew build || exit 1
echo "Starting cross-release tests."
source ./test_utils.sh
if [[ ${TRAVIS_BRANCH} == "master" ]]; then
# Assuming this is CI test. Perform cross-branch test for
# both schema and app. Note that app should be tested first,
# since schema test will end up at another commit.
echo "Testing application changes..."
testNewAppWithSchema || exit 1
echo "Testing schema changes..."
testNewSchemaWithApp
else
# Assuming this is Presubmit test. Only test changed part for faster response.
schemaChanges=$(countChangesInFolders subprojects/demo_schema)
if [[ ${schemaChanges} -gt 0 ]]; then
echo "Testing schema changes..."
testNewSchemaWithApp
else
echo "Testing application changes..."
testNewAppWithSchema
fi
fi