forked from dropbox/dropbox-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-integration-tests
executable file
·62 lines (47 loc) · 1.4 KB
/
run-integration-tests
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env bash
die() {
echo >&2 "error: release checks failed"
exit 1
}
# Exit immediately on any error.
set -euf
trap die SIGTERM
DIR=`dirname $(dirname "${BASH_SOURCE[0]}")`
run() {
echo "================================================================================"
echo " CMD: $@"
echo " OUTPUT:"
$@ || die
echo "================================================================================"
}
gradle() {
(cd "${DIR}" && run ./gradlew -c standalone-settings.gradle "$@")
}
android_gradle() {
(cd "${DIR}/examples/android" && run ./gradlew "$@")
}
if [ $# -ne 1 ] ; then
script=`basename "${0}"`
echo >&2 "usage: $script production-user-auth.json"
exit 1
fi
AUTH_FILE="${1}"
if [ ! -f "${AUTH_FILE}" ] ; then
echo >&2 "error: no such file: ${AUTH_FILE}"
exit 1
fi
tempfile=$(mktemp -t `basename "${BASH_SOURCE[0]}"`.XXXXXXXXXX)
function cleanup() {
[ ! -e "${tempfile}" ] || rm -f "${tempfile}"
}
trap cleanup EXIT
echo "Running integration tests..."
gradle clean
gradle check
# prepare examples to be run
android_gradle clean
android_gradle assemble
# Run integration tests against major HTTP requestor implementations
for requestor in "StandardHttpRequestor" "OkHttpRequestor" "OkHttp3Requestor" ; do
gradle -Pcom.dropbox.test.httpRequestor="${requestor}" -Pcom.dropbox.test.authInfoFile="${AUTH_FILE}" integrationTest proguardTest
done