Bug 1154796 - Update the in-tree copy of mozharness to rev cd537fcb6ff0. r=jlund, a=test-only
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 22 Jul 2015 13:59:39 -0400
changeset 281622 91c53b2795144d48845ad770b9bff251e192e471
parent 281621 4d1718174fd4fc74c95d4a3caf27d526cab11cc3
child 281623 e3fc822b34ceef21b19c5bed1e5b9f48f55ea94e
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlund, test-only
bugs1154796
milestone41.0a2
Bug 1154796 - Update the in-tree copy of mozharness to rev cd537fcb6ff0. r=jlund, a=test-only
testing/mozharness/README.txt
testing/mozharness/mozharness.json
testing/mozharness/mozharness/mozilla/testing/firefox_ui_tests.py
testing/mozharness/scripts/desktop_unittest.py
testing/mozharness/scripts/firefox_ui_updates.py
--- a/testing/mozharness/README.txt
+++ b/testing/mozharness/README.txt
@@ -1,11 +1,11 @@
 the contents of this dir (testing/mozharness) represent two parts
 
 1) the old way: mozharness.json is a manifest file that locks or "pins" mozharness to a repository and a revision.
 
 2) the new way: an in-gecko-tree copy of mozharness.
     * hgmo/build/mozharness is still live and the defacto read/write repository
     * continuous integration jobs are based on this copy
     * As we transition to dropping support for hg.m.o/build/mozharness, this copy will continue to be synced
-    * this copy is currently based on: http://hg.mozilla.org/build/mozharness/rev/239491bc393a
+    * this copy is currently based on: http://hg.mozilla.org/build/mozharness/rev/cd537fcb6ff0
 
 
--- a/testing/mozharness/mozharness.json
+++ b/testing/mozharness/mozharness.json
@@ -1,4 +1,4 @@
 {
     "repo": "https://hg.mozilla.org/build/mozharness",
-    "revision": "239491bc393a"
+    "revision": "cd537fcb6ff0"
 }
--- a/testing/mozharness/mozharness/mozilla/testing/firefox_ui_tests.py
+++ b/testing/mozharness/mozharness/mozilla/testing/firefox_ui_tests.py
@@ -13,58 +13,46 @@ import sys
 import os
 
 from mozharness.base.python import (
     PreScriptAction,
     VirtualenvMixin,
     virtualenv_config_options,
 )
 from mozharness.mozilla.vcstools import VCSToolsScript
-from mozharness.mozilla.purge import PurgeMixin
 
 
-class FirefoxUITests(VCSToolsScript, VirtualenvMixin, PurgeMixin):
+class FirefoxUITests(VCSToolsScript, VirtualenvMixin):
     config_options = [
         [['--firefox-ui-repo'], {
             'dest': 'firefox_ui_repo',
             'default': 'https://github.com/mozilla/firefox-ui-tests.git',
             'help': 'which firefox_ui_tests repo to use',
         }],
         [['--firefox-ui-branch'], {
             'dest': 'firefox_ui_branch',
             'help': 'which branch to use for firefox_ui_tests',
         }],
     ] + copy.deepcopy(virtualenv_config_options)
 
-    def __init__(self,
-                 config={},
-                 config_options=[],
-                 all_actions=[],
-                 **kwargs):
-        default_config = {
-            'purge_minsize': 2,
-        }
-        default_config.update(config)
 
+    def __init__(self, config_options=[], all_actions=[], **kwargs):
         self.config_options += config_options
 
         if all_actions is None:
             # Default actions
             all_actions = [
-                'purge-builds',
                 'clobber',
                 'checkout',
                 'create-virtualenv',
                 'run-tests',
             ]
 
         super(FirefoxUITests, self).__init__(
             config_options=self.config_options,
-            require_config_file=True,
-            config=default_config,
             all_actions=all_actions,
             **kwargs
         )
 
         self.firefox_ui_repo = self.config['firefox_ui_repo']
         self.firefox_ui_branch = self.config.get('firefox_ui_branch')
 
         if not self.firefox_ui_branch:
--- a/testing/mozharness/scripts/desktop_unittest.py
+++ b/testing/mozharness/scripts/desktop_unittest.py
@@ -283,45 +283,69 @@ class DesktopUnittest(TestingMixin, Merc
                 self.fatal("self.installer_url was found but symbols_url could \
                         not be determined")
         else:
             self.fatal("self.installer_url was not found in self.config")
         self.info("setting symbols_url as %s" % (symbols_url))
         self.symbols_url = symbols_url
         return self.symbols_url
 
+    def get_webapprt_path(self, res_dir, mochitest_dir):
+        """Get the path to the webapp runtime binary.
+        On Mac, we copy the stub from the resources dir to the test app bundle,
+        since we have to run it from the executable directory of a bundle
+        in order for its windows to appear.  Ideally, the build system would do
+        this for us at build time, and we should find a way for it to do that.
+        """
+        exe_suffix = self.config.get('exe_suffix', '')
+        app_name = 'webapprt-stub' + exe_suffix
+        app_path = os.path.join(res_dir, app_name)
+        if self._is_darwin():
+            mac_dir_name = os.path.join(
+                mochitest_dir,
+                'webapprtChrome',
+                'webapprt',
+                'test',
+                'chrome',
+                'TestApp.app',
+                'Contents',
+                'MacOS')
+            mac_app_name = 'webapprt' + exe_suffix
+            mac_app_path = os.path.join(mac_dir_name, mac_app_name)
+            self.copyfile(app_path, mac_app_path, copystat=True)
+            return mac_app_path
+        return app_path
+
     def _query_abs_base_cmd(self, suite_category, suite):
         if self.binary_path:
             c = self.config
             dirs = self.query_abs_dirs()
             run_file = c['run_file_names'][suite_category]
             base_cmd = [self.query_python_path('python'), '-u']
             base_cmd.append(os.path.join(dirs["abs_%s_dir" % suite_category], run_file))
             abs_app_dir = self.query_abs_app_dir()
             abs_res_dir = self.query_abs_res_dir()
 
-            webapprt_path = os.path.join(os.path.dirname(self.binary_path),
-                                         'webapprt-stub')
-            if c.get('exe_suffix'):
-                webapprt_path += c['exe_suffix']
-
             raw_log_file = os.path.join(dirs['abs_blob_upload_dir'],
                                         '%s_raw.log' % suite)
             str_format_values = {
                 'binary_path': self.binary_path,
                 'symbols_path': self._query_symbols_url(),
                 'abs_app_dir': abs_app_dir,
-                'app_path': webapprt_path,
+                'abs_res_dir': abs_res_dir,
                 'raw_log_file': raw_log_file,
             }
             # TestingMixin._download_and_extract_symbols() will set
             # self.symbols_path when downloading/extracting.
             if self.symbols_path:
                 str_format_values['symbols_path'] = self.symbols_path
 
+            if suite_category == 'webapprt':
+                str_format_values['app_path'] = self.get_webapprt_path(abs_res_dir, dirs['abs_mochitest_dir'])
+
             if c['e10s']:
                 base_cmd.append('--e10s')
 
             if c.get('strict_content_sandbox'):
                 if suite_category == "mochitest":
                     base_cmd.append('--strict-content-sandbox')
                 else:
                     self.fatal("--strict-content-sandbox only works with mochitest suites.")
--- a/testing/mozharness/scripts/firefox_ui_updates.py
+++ b/testing/mozharness/scripts/firefox_ui_updates.py
@@ -98,17 +98,16 @@ class FirefoxUIUpdates(FirefoxUITests):
                 'dest': 'installer_path',
                 'help': 'Point to an installer to test against.',
             }],
         ] + copy.deepcopy(self.harness_extra_args)
 
         super(FirefoxUIUpdates, self).__init__(
             config_options=config_options,
             all_actions=[
-                'purge-builds',
                 'clobber',
                 'checkout',
                 'create-virtualenv',
                 'determine-testing-configuration',
                 'run-tests',
             ],
             append_env_variables_from_configs=True,
         )