-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare the script to run tests on Android emulator (#4387)
Summary: Unlike other Linux job where we can use Docker images, Android emulator needs to be run directly on our Linux runner as I don't know if Docker supports KVM which is needed to emulate the devices. * Requires Amazon Linux 2023 or GitHub ubuntu for node 20 * Use https://github.com/ReactiveCircus/android-emulator-runner GHA to simplify the setup of the emulator devices instead of writing our own script * It takes about 10m to cold boot the emulator Pull Request resolved: #4387 Reviewed By: guangy10, kirklandsign Differential Revision: D60165361 Pulled By: huydhn fbshipit-source-id: c66c3be9a5c90ea72ba8c295d2b088168b30c115
- Loading branch information
1 parent
d6d691e
commit 85d4d12
Showing
3 changed files
with
112 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# All rights reserved. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
set -ex | ||
|
||
# This script is originally adopted from https://github.com/pytorch/pytorch/blob/main/android/run_tests.sh | ||
ADB_PATH=$ANDROID_HOME/platform-tools/adb | ||
|
||
echo "Waiting for emulator boot to complete" | ||
# shellcheck disable=SC2016 | ||
$ADB_PATH wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 5; done;' | ||
|
||
# The device will be created by ReactiveCircus/android-emulator-runner GHA | ||
echo "List all running emulators" | ||
$ADB_PATH devices | ||
|
||
# TODO: Run tests on emulator here, atm the script only boots up the emulator | ||
# and exits without doing anything yet |