Run Android Instrumentation Tests as part of PR workflow (#2309)

This commit is contained in:
Bart Louwers
2024-04-22 22:47:22 +02:00
committed by GitHub
parent d5775d374b
commit 8ad141e213
6 changed files with 55 additions and 110 deletions

View File

@@ -1,14 +1,16 @@
#!/bin/bash
set -e
# Check if the required variables are defined
if [ -z "$RESULTS_API" ] || [ -z "$AWS_DEVICE_FARM_PROJECT_ARN" ]; then
echo "Error: Missing required variables."
usage
exit 1
fi
cd "$(mktemp -d)"
cat << EOF > benchmark-input.json
cat << EOF > instrumentation-test-input.json
{
"styleNames": ["Facebook Light", "MapTiler Basic", "Americana"],
"styleURLs": [
@@ -16,15 +18,16 @@ cat << EOF > benchmark-input.json
"https://api.maptiler.com/maps/basic-v2/style.json?key=get_your_own_OpIi9ZULNHzrESv6T2vL",
"https://zelonewolf.github.io/openstreetmap-americana/style.json"
],
"resultsAPI": "$RESULTS_API"
"resultsAPI": "$RESULTS_API",
"apiKey": "get_your_own_OpIi9ZULNHzrESv6T2vL"
}
EOF
>&2 zip benchmark-input.zip benchmark-input.json
upload_json="$(aws devicefarm create-upload --project-arn "$AWS_DEVICE_FARM_PROJECT_ARN" --type EXTERNAL_DATA --name benchmark-input.zip --output json)"
>&2 zip instrumentation-test-input.zip instrumentation-test-input.json
upload_json="$(aws devicefarm create-upload --project-arn "$AWS_DEVICE_FARM_PROJECT_ARN" --type EXTERNAL_DATA --name instrumentation-test-input.zip --output json)"
upload_url="$(echo "$upload_json" | jq -r '.upload.url')"
upload_arn="$(echo "$upload_json" | jq -r '.upload.arn')"
curl -T benchmark-input.zip "$upload_url"
curl -T instrumentation-test-input.zip "$upload_url"
retries=5
while true; do