Created
March 27, 2019 03:36
-
-
Save qwertyfinger/0a9b6a5fc8a27c71cd66ecb70879b0dd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/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=walleye,version=28,locale=en_US,orientation=portrait \ | |
--timeout 20m \ | |
--results-dir=${RESULTS_DIR} \ | |
--environment-variables coverage=true,coverageFile=/sdcard/tmp/code-coverage/connected/coverage.ec \ | |
--directories-to-pull=/sdcard/tmp \ | |
--no-record-video \ | |
--no-performance-metrics | |
TEST_RESULT=$? | |
# Make result dir | |
mkdir -p "$TEST_DIR/$RESULTS_DIR" | |
# Pull down test results | |
gsutil -m cp -r -U "gs://test-lab-{your-bucket-id}/$RESULTS_DIR/*" "$TEST_DIR/$RESULTS_DIR" | |
return ${TEST_RESULT} | |
} | |
test_apk \ | |
"app" \ | |
"app/build/outputs/apk/debug/app-debug.apk" \ | |
"app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment