forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
firebase_testlab.sh
executable file
·49 lines (42 loc) · 1.6 KB
/
firebase_testlab.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
#
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e
APP="$1"
if [[ -z "$APP" ]]; then
echo "Application must be specified as the first argument to the script."
exit 255
fi
if [[ ! -f "$APP" ]]; then
echo "File '$APP' not found."
exit 255
fi
GIT_REVISION="${2:-$(git rev-parse HEAD)}"
BUILD_ID="${3:-$CIRRUS_BUILD_ID}"
if [[ -n $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"
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 --project flutter-infra firebase test android run \
--type game-loop \
--app "$APP" \
--timeout 2m \
--results-bucket=gs://flutter_firebase_testlab \
--results-dir="engine_scenario_test/$GIT_REVISION/$BUILD_ID" \
--no-auto-google-login