Skip to content

Commit

Permalink
Get FTL test running again (flutter#25771)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnfield committed Apr 27, 2021
1 parent b56fa62 commit 79e0d26
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 28 deletions.
20 changes: 3 additions & 17 deletions ci/firebase_testlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,7 @@ if [[ ! -f "$APP" ]]; then
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
BUILD_ID="${3:-$SWARMING_TASK_ID}"

# Run the test.
# game-loop tests are meant for OpenGL apps.
Expand All @@ -46,4 +31,5 @@ gcloud --project flutter-infra firebase test android run \
--timeout 2m \
--results-bucket=gs://flutter_firebase_testlab \
--results-dir="engine_scenario_test/$GIT_REVISION/$BUILD_ID" \
--no-auto-google-login
# Pixel 4. As of this commit, this is a highly available device in FTL.
--device model=flame,version=29
5 changes: 0 additions & 5 deletions testing/scenario_app/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@
android:launchMode="singleTop"
android:windowSoftInputMode="adjustResize"
android:theme="@style/FullScreenScreenshot">
<intent-filter>
<action android:name="com.google.intent.action.TEST_LOOP" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/javascript" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
2 changes: 1 addition & 1 deletion testing/scenario_app/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.0'
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.facebook.testing.screenshot:plugin:0.12.0'

// NOTE: Do not place your application dependencies here; they belong
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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-5.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
6 changes: 5 additions & 1 deletion testing/scenario_app/assemble_apk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ SRC_DIR="$(cd "$SCRIPT_DIR/../../.."; pwd -P)"
export ANDROID_HOME="$SRC_DIR/third_party/android_tools/sdk"

"$SRC_DIR/flutter/tools/gn" --unopt
autoninja -C "$SRC_DIR/out/host_debug_unopt" sky_engine sky_services
ninja -C "$SRC_DIR/out/host_debug_unopt" sky_engine sky_services -j 400

"$SCRIPT_DIR/compile_android_aot.sh" "$1" "$2"

(
cd "$SCRIPT_DIR/android"
./gradlew assembleDebug --no-daemon
)

# LUCI expects to find the APK here
mkdir -p "$SCRIPT_DIR/android/app/build/outputs/apk/debug"
cp "$SCRIPT_DIR/build/app/outputs/apk/debug/app-debug.apk" "$SCRIPT_DIR/android/app/build/outputs/apk/debug"
12 changes: 9 additions & 3 deletions testing/scenario_app/compile_android_aot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fi

if [[ ! -d "$DEVICE_TOOLS" ]]; then
echo "Directory $DEVICE_TOOLS not found."
ehco "Second argument must specify the device out directory containing gen_snapshot (e.g. out/android_debug_unopt_x64/clang_x64)."
echo "Second argument must specify the device out directory containing gen_snapshot (e.g. out/android_debug_unopt_x64/clang_x64)."
exit 1
fi

Expand All @@ -61,16 +61,22 @@ mkdir -p "$OUTDIR"

echo "Compiling kernel..."

# --disable-dart-dev: No need for observatory/DDS.
# --no-print-incremental-dependencies: Avoid printing out a lot of verbosity that doesn't help this test.
"$HOST_TOOLS/dart" \
--disable-dart-dev \
"$HOST_TOOLS/gen/frontend_server.dart.snapshot" \
--sdk-root "$HOST_TOOLS/flutter_patched_sdk" \
--aot --tfa --target=flutter \
--target=flutter \
--no-print-incremental-dependencies \
--aot \
--tfa \
--output-dill "$OUTDIR/app.dill" \
"$SCRIPT_DIR/lib/main.dart"

echo "Compiling ELF Shared Library..."

"$HOST_TOOLS/gen_snapshot" --deterministic --snapshot_kind=app-aot-elf --elf="$OUTDIR/libapp.so" --strip "$OUTDIR/app.dill"
"$DEVICE_TOOLS/gen_snapshot" --deterministic --snapshot_kind=app-aot-elf --elf="$OUTDIR/libapp.so" --strip "$OUTDIR/app.dill"

mkdir -p "$SCRIPT_DIR/android/app/src/main/jniLibs/arm64-v8a"
mkdir -p "$SCRIPT_DIR/android/app/libs"
Expand Down

0 comments on commit 79e0d26

Please sign in to comment.