Skip to content

Commit ff49ca1

Browse files
authored
Make firebase test more LUCI friendly (#10783)
1 parent 0c42c51 commit ff49ca1

File tree

3 files changed

+26
-17
lines changed

3 files changed

+26
-17
lines changed

ci/firebase_testlab.sh

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,38 @@
22

33
set -e
44

5-
GIT_REVISION=$(git rev-parse HEAD)
6-
75
if [[ ! -f $1 ]]; then
86
echo "File $1 not found."
97
exit -1
108
fi
119

12-
# New contributors will not have permissions to run this test - they won't be
13-
# able to access the service account information. We should just mark the test
14-
# as passed - it will run fine on post submit, where it will still catch
15-
# failures.
16-
# We can also still make sure that building a release app bundle still works.
17-
if [[ $GCLOUD_FIREBASE_TESTLAB_KEY == ENCRYPTED* ]]; then
18-
echo "This user does not have permission to run this test."
19-
exit 0
20-
fi
10+
GIT_REVISION=${2:-$(git rev-parse HEAD)}
11+
BUILD_ID=${3:-$CIRRUS_BUILD_ID}
2112

22-
echo $GCLOUD_FIREBASE_TESTLAB_KEY > ${HOME}/gcloud-service-key.json
23-
gcloud auth activate-service-account --key-file=${HOME}/gcloud-service-key.json
24-
gcloud --quiet config set project flutter-infra
13+
if [[ ! -z $GCLOUD_FIREBASE_TESTLAB_KEY ]]; then
14+
# New contributors will not have permissions to run this test - they won't be
15+
# able to access the service account information. We should just mark the test
16+
# as passed - it will run fine on post submit, where it will still catch
17+
# failures.
18+
# We can also still make sure that building a release app bundle still works.
19+
if [[ $GCLOUD_FIREBASE_TESTLAB_KEY == ENCRYPTED* ]]; then
20+
echo "This user does not have permission to run this test."
21+
exit 0
22+
fi
23+
24+
echo $GCLOUD_FIREBASE_TESTLAB_KEY > ${HOME}/gcloud-service-key.json
25+
gcloud auth activate-service-account --key-file=${HOME}/gcloud-service-key.json
26+
fi
2527

2628
# Run the test.
2729
# game-loop tests are meant for OpenGL apps.
2830
# This type of test will give the application a handle to a file, and
2931
# we'll write the timeline JSON to that file.
3032
# See https://firebase.google.com/docs/test-lab/android/game-loop
31-
gcloud firebase test android run \
33+
gcloud --project flutter-infra firebase test android run \
3234
--type game-loop \
3335
--app $1 \
3436
--timeout 2m \
3537
--results-bucket=gs://flutter_firebase_testlab \
36-
--results-dir=engine_scenario_test/$GIT_REVISION/$CIRRUS_BUILD_ID
38+
--results-dir=engine_scenario_test/$GIT_REVISION/$BUILD_ID
3739

testing/scenario_app/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
./compile_android_aot.sh $1 $2
4+
5+
pushd android
6+
./gradlew assembleDebug --no-daemon
7+
popd

0 commit comments

Comments
 (0)