Bug 1380141 - Running Talos locally on OS X results in crashed tabs. r=Alex_Gaynor, r?jmaher draft
authorHaik Aftandilian <haftandilian@mozilla.com>
Wed, 12 Jul 2017 17:05:29 -0700
changeset 608543 c5957aef4a09feacabf542bac74b180e628a4bf1
parent 608541 bda741877280ff867328346fdf46fd3cdb5a5d5d
child 637338 8f45e41e15f5ea29090b09f7b723b62625c4d96a
push id68314
push userhaftandilian@mozilla.com
push dateThu, 13 Jul 2017 20:12:40 +0000
reviewersAlex_Gaynor, jmaher
bugs1380141
milestone56.0a1
Bug 1380141 - Running Talos locally on OS X results in crashed tabs. r=Alex_Gaynor, r?jmaher Like we do for mochitests, set the MOZ_DEVELOPER_REPO_DIR and MOZ_DEVELOPER_OBJ_DIR environment variables when running talos tests so that the content sandbox permits access to test files that are symlinks from the .app/ directory to the repo or object directory. MozReview-Commit-ID: J1bRqoB8a2i
testing/mozharness/mozharness/mozilla/testing/talos.py
testing/talos/mach_commands.py
--- a/testing/mozharness/mozharness/mozilla/testing/talos.py
+++ b/testing/mozharness/mozharness/mozilla/testing/talos.py
@@ -169,16 +169,18 @@ class Talos(TestingMixin, MercurialScrip
 
         self.workdir = self.query_abs_dirs()['abs_work_dir']  # convenience
 
         self.run_local = self.config.get('run_local')
         self.installer_url = self.config.get("installer_url")
         self.talos_json_url = self.config.get("talos_json_url")
         self.talos_json = self.config.get("talos_json")
         self.talos_json_config = self.config.get("talos_json_config")
+        self.repo_path = self.config.get("repo_path")
+        self.obj_path = self.config.get("obj_path")
         self.tests = None
         self.gecko_profile = self.config.get('gecko_profile')
         self.gecko_profile_interval = self.config.get('gecko_profile_interval')
         self.pagesets_name = None
         self.mitmproxy_recording_set = None # zip file found on tooltool that contains all of the mitmproxy recordings
         self.mitmproxy_recordings_file_list = self.config.get('mitmproxy', None) # files inside the recording set
         self.mitmdump = None # path to mitdump tool itself, in py3 venv
 
@@ -545,16 +547,21 @@ class Talos(TestingMixin, MercurialScrip
         if 'PYTHONPATH' in env:
             env['PYTHONPATH'] = self.talos_path + os.pathsep + env['PYTHONPATH']
         else:
             env['PYTHONPATH'] = self.talos_path
 
         # mitmproxy needs path to mozharness when installing the cert
         env['SCRIPTSPATH'] = scripts_path
 
+        if self.repo_path is not None:
+            env['MOZ_DEVELOPER_REPO_DIR'] = self.repo_path
+        if self.obj_path is not None:
+            env['MOZ_DEVELOPER_OBJ_DIR'] = self.obj_path
+
         # sets a timeout for how long talos should run without output
         output_timeout = self.config.get('talos_output_timeout', 3600)
         # run talos tests
         run_tests = os.path.join(self.talos_path, 'talos', 'run_tests.py')
 
         mozlog_opts = ['--log-tbpl-level=debug']
         if not self.run_local and 'suite' in self.config:
             fname_pattern = '%s_%%s.log' % self.config['suite']
--- a/testing/talos/mach_commands.py
+++ b/testing/talos/mach_commands.py
@@ -47,16 +47,18 @@ class TalosRunner(MozbuildObject):
         self.python_interp = sys.executable
         self.talos_args = talos_args
 
     def make_config(self):
         self.config = {
             'run_local': True,
             'talos_json': self.talos_json,
             'binary_path': self.binary_path,
+            'repo_path': self.topsrcdir,
+            'obj_path': self.topobjdir,
             'log_name': 'talos',
             'virtualenv_path': self.virtualenv_path,
             'pypi_url': 'http://pypi.python.org/simple',
             'base_work_dir': self.mozharness_dir,
             'exes': {
                 'python': self.python_interp,
                 'virtualenv': [self.python_interp, self.virtualenv_script]
             },