Bug 1817250 - Add/Enable Robo Test on Firebase Test Lab

fenix/112.0
Aaron Train 1 year ago committed by mergify[bot]
parent 49f2ca6ac3
commit a3b65617a6

@ -0,0 +1,39 @@
# Google Cloud Documentation: https://cloud.google.com/sdk/gcloud/reference/firebase/test/android/run
# Flank Documentation: https://flank.github.io/flank/
gcloud:
results-bucket: fenix_test_artifacts
record-video: true
timeout: 10m
async: false
app: /app/path
auto-google-login: false
use-orchestrator: true
environment-variables:
clearPackageData: true
device:
- model: Pixel2.arm
version: 26
locale: en_US
- model: walleye
version: 27
locale: en_US
- model: dreamlte
version: 28
locale: en_US
- model: HWCOR
version: 27
locale: en_US
- model: blueline
version: 28
locale: en_US
type: robo
flank:
project: GOOGLE_PROJECT
num-test-runs: 1
output-style: compact
full-junit-result: true

@ -0,0 +1,101 @@
#!/usr/bin/env bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# This script does the following:
# 1. Retrieves gcloud service account token
# 2. Activates gcloud service account
# 3. Connects to Google's Firebase Test Lab (using Flank)
# 4. Executes Robo test
# 5. Puts any artifacts into the test_artifacts folder
# If a command fails then do not proceed and fail this script too.
set -e
get_abs_filename() {
relative_filename="$1"
echo "$(cd "$(dirname "$relative_filename")" && pwd)/$(basename "$relative_filename")"
}
# Basic parameter check
if [[ $# -lt 1 ]]; then
echo "Error: please provide a Flank configuration"
display_help
exit 1
fi
device_type="$1" # flank-arm-robo-test.yml | flank-x86-robo-test.yml
APK_APP="$2"
JAVA_BIN="/usr/bin/java"
PATH_TEST="./automation/taskcluster/androidTest"
FLANK_BIN="/builds/worker/test-tools/flank.jar"
ARTIFACT_DIR="/builds/worker/artifacts"
RESULTS_DIR="${ARTIFACT_DIR}/results"
echo
echo "ACTIVATE SERVICE ACCT"
echo
gcloud config set project "$GOOGLE_PROJECT"
gcloud auth activate-service-account --key-file "$GOOGLE_APPLICATION_CREDENTIALS"
echo
echo
echo
set +e
flank_template="${PATH_TEST}/flank-${device_type}.yml"
if [ -f "$flank_template" ]; then
echo "Using Flank template: $flank_template"
else
echo "Error: Flank template not found: $flank_template"
exit 1
fi
APK_APP="$(get_abs_filename $APK_APP)"
function failure_check() {
echo
echo
if [[ $exitcode -ne 0 ]]; then
echo "FAILURE: Robo test run failed, please check above URL"
else
echo "Robo test was successful!"
fi
echo
echo "RESULTS"
echo
mkdir -p /builds/worker/artifacts/github
chmod +x $PATH_TEST/parse-ui-test.py
$PATH_TEST/parse-ui-test.py \
--exit-code "${exitcode}" \
--log flank.log \
--results "${RESULTS_DIR}" \
--output-md "${ARTIFACT_DIR}/github/customCheckRunText.md" \
--device-type "${device_type}"
}
echo
echo "FLANK VERSION"
echo
$JAVA_BIN -jar $FLANK_BIN --version
echo
echo
echo
echo "EXECUTE ROBO TEST"
echo
set -o pipefail && $JAVA_BIN -jar $FLANK_BIN android run \
--config=$flank_template \
--app=$APK_APP \
--local-result-dir="${RESULTS_DIR}" \
--project=$GOOGLE_PROJECT \
--client-details=commit=${MOBILE_HEAD_REV:-None},pullRequest=${PULL_REQUEST_NUMBER:-None} \
| tee flank.log
exitcode=$?
failure_check
exit $exitcode
Loading…
Cancel
Save