Bug 1535417 - Set dynamic mozinfo fields in Android test-verify; r=bc
authorGeoff Brown <gbrown@mozilla.com>
Tue, 19 Mar 2019 18:11:44 +0000
changeset 465076 f45661298ac32d7f9dc451bd1d1a703a45abffd0
parent 465075 339f5b718539f0226cb1c9ac638b358d4fe8113a
child 465077 d77a06489c3e80ac21c4ab75fb2e8af4236d95d7
push id35732
push useropoprus@mozilla.com
push dateWed, 20 Mar 2019 10:52:37 +0000
treeherdermozilla-central@708979f9c3f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbc
bugs1535417
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1535417 - Set dynamic mozinfo fields in Android test-verify; r=bc In the mochitest harness, is_fennec is populated by examining harness options, and is_emulator and android_version are populated by examining the device via mozdevice. The per-test code doesn't have those options and the emulator may not be available yet, so I've opted for populated those fields from mozharness configuration. In practice, we only run Android TV on Android 4.3, where is_fennec=True, is_emulator=True, and android_version=18. I'd like to run TV on Android 7.0/geckoview eventually, where is_fennec=False, is_emulator=True, and android_version=24. Since I was here, I also removed 'stylo' from the per-test mozinfo, since that field is obsolete now. Differential Revision: https://phabricator.services.mozilla.com/D23595
testing/mozharness/configs/android/androidarm_4_3.py
testing/mozharness/configs/android/androidx86_7_0.py
testing/mozharness/mozharness/mozilla/testing/per_test_base.py
--- a/testing/mozharness/configs/android/androidarm_4_3.py
+++ b/testing/mozharness/configs/android/androidarm_4_3.py
@@ -26,9 +26,13 @@ config = {
     },
     "env": {
         "DISPLAY": ":0.0",
         "PATH": "%(PATH)s:%(abs_work_dir)s/android-sdk-linux/tools:%(abs_work_dir)s/android-sdk-linux/platform-tools",
         "MINIDUMP_SAVEPATH": "%(abs_work_dir)s/../minidumps"
     },
     "marionette_extra": "--emulator",
     "bogomips_minimum": 250,
+    # in support of test-verify
+    "android_version": 18,
+    "is_fennec": True,
+    "is_emulator": True,
 }
--- a/testing/mozharness/configs/android/androidx86_7_0.py
+++ b/testing/mozharness/configs/android/androidx86_7_0.py
@@ -24,9 +24,13 @@ config = {
     },
     "env": {
         "DISPLAY": ":0.0",
         "PATH": "%(PATH)s:%(abs_work_dir)s/android-sdk-linux/emulator:%(abs_work_dir)s/android-sdk-linux/tools:%(abs_work_dir)s/android-sdk-linux/platform-tools",
         "MINIDUMP_SAVEPATH": "%(abs_work_dir)s/../minidumps",
         # "LIBGL_DEBUG": "verbose"
     },
     "marionette_extra": "--emulator",
+    # in support of test-verify
+    "android_version": 24,
+    "is_fennec": False,
+    "is_emulator": True,
 }
--- a/testing/mozharness/mozharness/mozilla/testing/per_test_base.py
+++ b/testing/mozharness/mozharness/mozilla/testing/per_test_base.py
@@ -227,18 +227,22 @@ class SingleTestMixin(FetchesMixin):
             return response
 
         dirs = self.query_abs_dirs()
         mozinfo.find_and_update_from_json(dirs['abs_test_install_dir'])
         e10s = self.config.get('e10s', False)
         mozinfo.update({"e10s": e10s})
         headless = self.config.get('headless', False)
         mozinfo.update({"headless": headless})
-        # FIXME(emilio): Need to update test expectations.
-        mozinfo.update({'stylo': True})
+        if mozinfo.info['buildapp'] == 'mobile/android':
+            # extra android mozinfo normally comes from device queries, but this
+            # code may run before the device is ready, so rely on configuration
+            mozinfo.update({'android_version': self.config.get('android_version', 18)})
+            mozinfo.update({'is_fennec': self.config.get('is_fennec', True)})
+            mozinfo.update({'is_emulator': self.config.get('is_emulator', True)})
         mozinfo.update({'verify': True})
         self.info("Per-test run using mozinfo: %s" % str(mozinfo.info))
 
         changed_files = set()
         if os.environ.get('MOZHARNESS_TEST_PATHS', None) is not None:
             suite_to_paths = json.loads(os.environ['MOZHARNESS_TEST_PATHS'])
             specified_files = itertools.chain.from_iterable(suite_to_paths.values())
             changed_files.update(specified_files)