File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ while [[ $# -gt 1 ]]; do
4+ case $1 in
5+ -h|--help)
6+ # show help
7+ echo " Showing help"
8+ exit 0
9+ ;;
10+ -d|--devices)
11+ DEVICES=" $2 "
12+ shift # past argument
13+ ;;
14+ -s|--sdks)
15+ SDKS=" $2 "
16+ shift # past argument
17+ ;;
18+ -l|--locales)
19+ LOCALES=" $2 "
20+ shift # past argument
21+ ;;
22+ -p|--project)
23+ PROJECT=" $2 "
24+ shift # past argument
25+ ;;
26+ -o|--orientations)
27+ ORIENTATIONS=" $2 "
28+ shift # past argument
29+ ;;
30+ -r|--apk-release-path)
31+ PROD_APK_PATH=" $2 "
32+ shift # past argument
33+ ;;
34+ -t|--apk-test-path)
35+ TEST_APK_PATH=" $2 "
36+ shift # past argument
37+ ;;
38+ esac
39+ shift # past argument or value
40+ done
41+
42+ PROJECT=" ${PROJECT-" " } "
43+ DEVICES=" ${DEVICES-" Nexus5" } "
44+ SDKS=" ${SDKS-" 23" } "
45+ LOCALES=" ${LOCALES-" en" } "
46+ ORIENTATIONS=" ${ORIENTATIONS-" portrait" } "
47+ PROD_APK_PATH=" ${PROD_APK_PATH-" app-prod-release.apk" } "
48+ TEST_APK_PATH=" ${TEST_APK_PATH-" app-prod-release-androidTest.apk" } "
49+
50+ echo " Authenticating service account in google cloud..."
51+
52+ gcloud auth activate-service-account ${FIREBASE_SERVICE_ACCOUNT_EMAIL} --key-file=${FIREBASE_API_SECRET_FILE_PATH}
53+
54+ echo " Using project [${PROJECT} ] for firebase tests..."
55+ echo " "
56+
57+ gcloud config set project ${PROJECT}
58+
59+ echo " Testing project with the following configurations:"
60+ echo " Devices: [${DEVICES} ]"
61+ echo " SDK's: [${SDKS} ]"
62+ echo " Locales: [${LOCALES} ]"
63+ echo " Orientations: [${ORIENTATIONS} ]"
64+ echo " "
65+
66+ gcloud firebase test android run \
67+ --type instrumentation \
68+ --app ${PROD_APK_PATH} \
69+ --test ${TEST_APK_PATH} \
70+ --device-ids ${DEVICES} \
71+ --os-version-ids ${SDKS} \
72+ --locales ${LOCALES} \
73+ --orientations ${ORIENTATIONS}
You can’t perform that action at this time.
0 commit comments