Bug 1718341 - Use generated emulator when running WR Android jobs. r=nalexander

Differential Revision: https://phabricator.services.mozilla.com/D119222
This commit is contained in:
Agi Sferro 2021-07-15 23:22:16 +00:00
Родитель 164fc2191d
Коммит 84763440d5
2 изменённых файлов: 35 добавлений и 7 удалений

Просмотреть файл

@ -8,10 +8,29 @@
# mozharness configuration from android_common.py, or similar.
config = {
"tooltool_manifest_path": "testing/config/tooltool-manifests/androidx86_7_0/releng.manifest",
"emulator_avd_name": "test-1",
"emulator_process_name": "emulator64-x86",
"emulator_extra_args": "-gpu on -skip-adb-auth -verbose -show-kernel -ranchu -selinux permissive -memory 3072 -cores 4",
"emulator_avd_name": "mozemulator-x86_64",
"emulator_process_name": "qemu-system-x86_64",
"emulator_extra_args": [
"-gpu",
"on",
"-skip-adb-auth",
"-verbose",
"-show-kernel",
"-ranchu",
"-selinux",
"permissive",
"-memory",
"3072",
"-cores",
"4",
"-skin",
"800x1280",
"-no-snapstorage",
"-no-snapshot",
# Skips first-run dialogs
"-prop",
"ro.test_harness=true",
],
"exes": {
"adb": "%(abs_sdk_dir)s/platform-tools/adb",
},

Просмотреть файл

@ -78,7 +78,6 @@ class AndroidWrench(TestingMixin, BaseScript, MozbaseMixin, AndroidMixin):
if "abs_work_dir" in parent_abs_dirs:
abs_dirs["abs_work_dir"] = parent_abs_dirs["abs_work_dir"]
abs_dirs["abs_avds_dir"] = os.path.join(abs_dirs["abs_work_dir"], "avds")
abs_dirs["abs_blob_upload_dir"] = os.path.join(abs_dirs["abs_work_dir"], "logs")
abs_dirs["abs_apk_path"] = os.environ.get(
"WRENCH_APK", "gfx/wr/target/android-artifacts/debug/apk/wrench.apk"
@ -90,10 +89,14 @@ class AndroidWrench(TestingMixin, BaseScript, MozbaseMixin, AndroidMixin):
fetches_dir = os.environ.get("MOZ_FETCHES_DIR")
if self.is_emulator and fetches_dir:
abs_dirs["abs_sdk_dir"] = os.path.join(fetches_dir, "android-sdk-linux")
abs_dirs["abs_avds_dir"] = os.path.join(fetches_dir, "android-device")
else:
abs_dirs["abs_sdk_dir"] = os.path.join(
abs_dirs["abs_work_dir"], "android-sdk-linux"
)
abs_dirs["abs_avds_dir"] = os.path.join(
abs_dirs["abs_work_dir"], "android-device"
)
else:
mozbuild_path = os.environ.get(
"MOZBUILD_STATE_PATH", os.path.expanduser("~/.mozbuild")
@ -102,6 +105,10 @@ class AndroidWrench(TestingMixin, BaseScript, MozbaseMixin, AndroidMixin):
"ANDROID_SDK_HOME", os.path.join(mozbuild_path, "android-sdk-linux")
)
abs_dirs["abs_sdk_dir"] = mozbuild_sdk
avds_dir = os.environ.get(
"ANDROID_AVD_HOME", os.path.join(mozbuild_path, "android-device")
)
abs_dirs["abs_avds_dir"] = avds_dir
self.abs_dirs = abs_dirs
return self.abs_dirs
@ -235,8 +242,10 @@ class AndroidWrench(TestingMixin, BaseScript, MozbaseMixin, AndroidMixin):
# Running setup_avds will clobber the existing AVD and redownload it.
# For local testing that's kinda expensive, so we omit that if we
# already have that dir.
if not os.path.exists(self.query_abs_dirs()["abs_avds_dir"]):
self.setup_avds()
avds_dir = self.query_abs_dirs()["abs_avds_dir"]
if not os.path.exists(avds_dir):
self.error("Unable to find android AVDs at %s" % avds_dir)
return
sdk_path = self.query_abs_dirs()["abs_sdk_dir"]
if not os.path.exists(sdk_path):