From d92c927f76b0894059db87dc3fad3dc8c2a665c1 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Thu, 8 Aug 2019 15:31:22 -0700 Subject: [PATCH 1/4] make firebase test script more LUCI friendly --- ci/firebase_testlab.sh | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/ci/firebase_testlab.sh b/ci/firebase_testlab.sh index cb2c33332c373..f1707d7ddbc03 100755 --- a/ci/firebase_testlab.sh +++ b/ci/firebase_testlab.sh @@ -2,36 +2,39 @@ set -e -GIT_REVISION=$(git rev-parse HEAD) if [[ ! -f $1 ]]; then echo "File $1 not found." exit -1 fi -# New contributors will not have permissions to run this test - they won't be -# able to access the service account information. We should just mark the test -# as passed - it will run fine on post submit, where it will still catch -# failures. -# We can also still make sure that building a release app bundle still works. -if [[ $GCLOUD_FIREBASE_TESTLAB_KEY == ENCRYPTED* ]]; then - echo "This user does not have permission to run this test." - exit 0 -fi +GIT_REVISION=${$2:-$(git rev-parse HEAD)} +BUILD_ID=${$3:-$CIRRUS_BUILD_ID} + +if [[ ! -z $GCLOUD_FIREBASE_TESTLAB_KEY ]]; then + # New contributors will not have permissions to run this test - they won't be + # able to access the service account information. We should just mark the test + # as passed - it will run fine on post submit, where it will still catch + # failures. + # We can also still make sure that building a release app bundle still works. + if [[ $GCLOUD_FIREBASE_TESTLAB_KEY == ENCRYPTED* ]]; then + echo "This user does not have permission to run this test." + exit 0 + fi -echo $GCLOUD_FIREBASE_TESTLAB_KEY > ${HOME}/gcloud-service-key.json -gcloud auth activate-service-account --key-file=${HOME}/gcloud-service-key.json -gcloud --quiet config set project flutter-infra + echo $GCLOUD_FIREBASE_TESTLAB_KEY > ${HOME}/gcloud-service-key.json + gcloud auth activate-service-account --key-file=${HOME}/gcloud-service-key.json +fi # Run the test. # game-loop tests are meant for OpenGL apps. # This type of test will give the application a handle to a file, and # we'll write the timeline JSON to that file. # See https://firebase.google.com/docs/test-lab/android/game-loop -gcloud firebase test android run \ +gcloud --project flutter-infra firebase test android run \ --type game-loop \ --app $1 \ --timeout 2m \ --results-bucket=gs://flutter_firebase_testlab \ - --results-dir=engine_scenario_test/$GIT_REVISION/$CIRRUS_BUILD_ID + --results-dir=engine_scenario_test/$GIT_REVISION/$BUILD_ID From d43029a47002278e3c122759df07ebf826703800 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Thu, 8 Aug 2019 15:47:10 -0700 Subject: [PATCH 2/4] bump gradle version, add script to build apk in one shot --- .../android/gradle/wrapper/gradle-wrapper.properties | 2 +- testing/scenario_app/assemble_apk.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 testing/scenario_app/assemble_apk.sh diff --git a/testing/scenario_app/android/gradle/wrapper/gradle-wrapper.properties b/testing/scenario_app/android/gradle/wrapper/gradle-wrapper.properties index 57e33e9fe76d1..38499ceae5546 100644 --- a/testing/scenario_app/android/gradle/wrapper/gradle-wrapper.properties +++ b/testing/scenario_app/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip diff --git a/testing/scenario_app/assemble_apk.sh b/testing/scenario_app/assemble_apk.sh new file mode 100755 index 0000000000000..59269c57278ab --- /dev/null +++ b/testing/scenario_app/assemble_apk.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +./compile_android_aot.sh $1 $2 + +pushd android +./gradlew assembleDebug --no-daemon +popd From 8aa038b2784813e8c20562bd388f934ae2567ce0 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Thu, 8 Aug 2019 15:51:02 -0700 Subject: [PATCH 3/4] extra newline --- ci/firebase_testlab.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/firebase_testlab.sh b/ci/firebase_testlab.sh index f1707d7ddbc03..2ae1651dc1ae9 100755 --- a/ci/firebase_testlab.sh +++ b/ci/firebase_testlab.sh @@ -2,7 +2,6 @@ set -e - if [[ ! -f $1 ]]; then echo "File $1 not found." exit -1 From 98b51ed468fa9d518522930d8dcaa60fce95a81e Mon Sep 17 00:00:00 2001 From: Dan Field Date: Thu, 8 Aug 2019 21:11:49 -0700 Subject: [PATCH 4/4] bash --- ci/firebase_testlab.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/firebase_testlab.sh b/ci/firebase_testlab.sh index 2ae1651dc1ae9..341d4b8dd19cc 100755 --- a/ci/firebase_testlab.sh +++ b/ci/firebase_testlab.sh @@ -7,8 +7,8 @@ if [[ ! -f $1 ]]; then exit -1 fi -GIT_REVISION=${$2:-$(git rev-parse HEAD)} -BUILD_ID=${$3:-$CIRRUS_BUILD_ID} +GIT_REVISION=${2:-$(git rev-parse HEAD)} +BUILD_ID=${3:-$CIRRUS_BUILD_ID} if [[ ! -z $GCLOUD_FIREBASE_TESTLAB_KEY ]]; then # New contributors will not have permissions to run this test - they won't be