forked from nickbutcher/plaid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scripts for gcloud auth and running tests
- Loading branch information
Showing
3 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/sh | ||
|
||
BUILD_ID=$1 | ||
TEST_DIR=$2 | ||
|
||
test_apk() { | ||
RESULTS_DIR=$1_$BUILD_ID | ||
|
||
gcloud firebase test android run \ | ||
--type instrumentation \ | ||
--app $2 \ | ||
--test $3 \ | ||
--device model=Nexus6P,version=27,locale=en_US,orientation=portrait \ | ||
--timeout 30m \ | ||
--results-bucket cloud-test-android-devrel-ci \ | ||
--results-dir=$RESULTS_DIR \ | ||
--no-record-video \ | ||
--no-performance-metrics | ||
|
||
# Make result dir | ||
mkdir -p "$TEST_DIR/$RESULTS_DIR" | ||
|
||
# Pull down test results | ||
gsutil -m cp -r -U "gs://TODO-PROJECT-ID/$RESULTS_DIR/*" "$TEST_DIR/$RESULTS_DIR" | ||
} | ||
|
||
test_apk \ | ||
"app" \ | ||
"app/build/outputs/apk/debug/app-debug.apk" \ | ||
"app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
# Check if service key environment variable is set; exit if not | ||
if [ "$GCLOUD_SERVICE_KEY" = "" ]; then | ||
echo "GCLOUD_SERVICE_KEY env variable is empty. Exiting." | ||
exit 1 | ||
fi | ||
|
||
# Export to secrets file | ||
echo $GCLOUD_SERVICE_KEY | base64 -di > client_secret.json | ||
|
||
# Set project ID | ||
gcloud config set project TODO-PROJECT-ID | ||
|
||
# Auth account | ||
gcloud auth activate-service-account TODO-SERVICE-ACCT-ID --key-file client_secret.json | ||
|
||
# Delete secret | ||
rm client_secret.json |