Backed out changeset 50321440abee (bug 1332084) for android mass test bustage on a CLOSED TREE draft
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Mon, 13 Feb 2017 15:51:30 +0100
changeset 485852 070697e2159515ee2713751fde5d4e2fcbc2d837
parent 485851 a27fee22864b8a3deca22d83c46c77e4fa569435
child 485853 c0d38311f8392637b27e82a91d3434c7e07ab53c
push id45870
push userbmo:kechen@mozilla.com
push dateFri, 17 Feb 2017 09:36:54 +0000
bugs1332084
milestone54.0a1
backs out50321440abeee8c45ccdce76b6161f016435d07b
Backed out changeset 50321440abee (bug 1332084) for android mass test bustage on a CLOSED TREE
testing/mozharness/scripts/android_emulator_unittest.py
--- a/testing/mozharness/scripts/android_emulator_unittest.py
+++ b/testing/mozharness/scripts/android_emulator_unittest.py
@@ -411,23 +411,17 @@ class AndroidEmulatorTest(BlobUploadMixi
             os.close(tmpfd)
             self.info("Taking screenshot with %s; saving to %s" % (utility, filename))
             subprocess.call([utility, filename], env=self.query_env())
         except OSError, err:
             self.warning("Failed to take screenshot: %s" % err.strerror)
 
     def _query_package_name(self):
         if self.app_name is None:
-            # Find appname from package-name.txt - assumes download-and-extract
-            # has completed successfully.
-            # The app/package name will typically be org.mozilla.fennec,
-            # but org.mozilla.firefox for release builds, and there may be
-            # other variations. 'aapt dump badging <apk>' could be used as an
-            # alternative to package-name.txt, but introduces a dependency
-            # on aapt, found currently in the Android SDK build-tools component.
+            #find appname from package-name.txt - assumes download-and-extract has completed successfully
             apk_dir = self.abs_dirs['abs_work_dir']
             self.apk_path = os.path.join(apk_dir, self.installer_path)
             unzip = self.query_exe("unzip")
             package_path = os.path.join(apk_dir, 'package-name.txt')
             unzip_cmd = [unzip, '-q', '-o',  self.apk_path]
             self.run_command(unzip_cmd, cwd=apk_dir, halt_on_failure=True)
             self.app_name = str(self.read_from_file(package_path, verbose=True)).rstrip()
         return self.app_name
@@ -453,16 +447,17 @@ class AndroidEmulatorTest(BlobUploadMixi
         ]
 
         raw_log_file = os.path.join(dirs['abs_blob_upload_dir'],
                                     '%s_raw.log' % self.test_suite)
 
         error_summary_file = os.path.join(dirs['abs_blob_upload_dir'],
                                           '%s_errorsummary.log' % self.test_suite)
         str_format_values = {
+            'app': self._query_package_name(),
             'remote_webserver': c['remote_webserver'],
             'xre_path': self.xre_path,
             'utility_path': self.xre_path,
             'http_port': self.emulator['http_port'],
             'ssl_port': self.emulator['ssl_port'],
             'certs_path': os.path.join(dirs['abs_work_dir'], 'tests/certs'),
             # TestingMixin._download_and_extract_symbols() will set
             # self.symbols_path when downloading/extracting.
@@ -482,21 +477,17 @@ class AndroidEmulatorTest(BlobUploadMixi
         }
         for option in self.config["suite_definitions"][self.test_suite]["options"]:
             opt = option.split('=')[0]
             # override configured chunk options with script args, if specified
             if opt == '--this-chunk' and self.this_chunk is not None:
                 continue
             if opt == '--total-chunks' and self.total_chunks is not None:
                 continue
-            if opt == 'app':
-                # only query package name if requested
-                cmd.extend([option % self._query_package_name()])
-            else:
-                cmd.extend([option % str_format_values])
+            cmd.extend([option % str_format_values])
 
         if self.this_chunk is not None:
             cmd.extend(['--this-chunk', self.this_chunk])
         if self.total_chunks is not None:
             cmd.extend(['--total-chunks', self.total_chunks])
 
         try_options, try_tests = self.try_args(self.test_suite)
         cmd.extend(try_options)
@@ -727,17 +718,17 @@ class AndroidEmulatorTest(BlobUploadMixi
 
         assert self.installer_path is not None, \
             "Either add installer_path to the config or use --installer-path."
 
         self.sdk_level = self._run_with_timeout(30, [self.adb_path, '-s', self.emulator['device_id'],
             'shell', 'getprop', 'ro.build.version.sdk'])
 
         # Install Fennec
-        install_ok = self._retry(3, 30, self._install_fennec_apk, "Install app APK")
+        install_ok = self._retry(3, 30, self._install_fennec_apk, "Install Fennec APK")
         if not install_ok:
             self.fatal('INFRA-ERROR: Failed to install %s on %s' %
                 (self.installer_path, self.emulator["name"]), EXIT_STATUS_DICT[TBPL_RETRY])
 
         # Install Robocop if required
         if self.test_suite.startswith('robocop'):
             install_ok = self._retry(3, 30, self._install_robocop_apk, "Install Robocop APK")
             if not install_ok: