Bug 1308400 - Whitelist paths with test files during testing. r?Alex_Gaynor draft
authorGian-Carlo Pascutto <gcp@mozilla.com>
Fri, 30 Jun 2017 23:16:08 +0200
changeset 606221 40c9178e550444608fb2f9f8ebe26047e21dda28
parent 606220 ac58700cb02ece4ad83fb3c3851676c12fd5859e
child 606222 2490c53c0c0df09ae9e0e5ce32f1d5d750be9eb4
push id67644
push usergpascutto@mozilla.com
push dateMon, 10 Jul 2017 18:21:54 +0000
reviewersAlex_Gaynor
bugs1308400
milestone56.0a1
Bug 1308400 - Whitelist paths with test files during testing. r?Alex_Gaynor MozReview-Commit-ID: LMWAv3GP5c4
testing/mochitest/runtests.py
testing/mozharness/configs/unittests/linux_unittest.py
testing/mozharness/scripts/desktop_unittest.py
testing/xpcshell/runxpcshelltests.py
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -1747,16 +1747,17 @@ toolbar#nav-bar {
         if (mozinfo.info["asan"] or mozinfo.info["debug"]) and \
                 options.flavor == 'browser' and options.timeout is None:
             self.log.info("Increasing default timeout to 90 seconds")
             options.extraPrefs.append("testing.browserTestHarness.timeout=90")
 
         options.extraPrefs.append(
             "browser.tabs.remote.autostart=%s" %
             ('true' if options.e10s else 'false'))
+
         options.extraPrefs.append(
             "dom.ipc.tabs.nested.enabled=%s" %
             ('true' if options.nested_oop else 'false'))
 
         # get extensions to install
         extensions = self.getExtensionsToInstall(options)
 
         # preferences
--- a/testing/mozharness/configs/unittests/linux_unittest.py
+++ b/testing/mozharness/configs/unittests/linux_unittest.py
@@ -112,16 +112,17 @@ config = {
                 "--setpref=webgl.force-enabled=true",
                 "--quiet",
                 "--log-raw=%(raw_log_file)s",
                 "--log-errorsummary=%(error_summary_file)s",
                 "--use-test-media-devices",
                 "--screenshot-on-fail",
                 "--cleanup-crashes",
                 "--marionette-startup-timeout=180",
+                "--work-path=%(abs_work_dir)s",
             ],
             "run_filename": "runtests.py",
             "testsdir": "mochitest"
         },
         "mozbase": {
             "options": [
                 "-b",
                 "%(binary_path)s"
@@ -143,16 +144,17 @@ config = {
             "options": [
                 "--appname=%(binary_path)s",
                 "--utility-path=tests/bin",
                 "--extra-profile-file=tests/bin/plugins",
                 "--symbols-path=%(symbols_path)s",
                 "--log-raw=%(raw_log_file)s",
                 "--log-errorsummary=%(error_summary_file)s",
                 "--cleanup-crashes",
+                "--work-path=%(abs_work_dir)s",
             ],
             "run_filename": "runreftest.py",
             "testsdir": "reftest"
         },
         "xpcshell": {
             "options": [
                 "--symbols-path=%(symbols_path)s",
                 "--test-plugin-path=%(test_plugin_path)s",
--- a/testing/mozharness/scripts/desktop_unittest.py
+++ b/testing/mozharness/scripts/desktop_unittest.py
@@ -236,16 +236,17 @@ class DesktopUnittest(TestingMixin, Merc
 
     def query_abs_dirs(self):
         if self.abs_dirs:
             return self.abs_dirs
         abs_dirs = super(DesktopUnittest, self).query_abs_dirs()
 
         c = self.config
         dirs = {}
+        dirs['abs_work_dir'] = abs_dirs['abs_work_dir']
         dirs['abs_app_install_dir'] = os.path.join(abs_dirs['abs_work_dir'], 'application')
         dirs['abs_test_install_dir'] = os.path.join(abs_dirs['abs_work_dir'], 'tests')
         dirs['abs_test_extensions_dir'] = os.path.join(dirs['abs_test_install_dir'], 'extensions')
         dirs['abs_test_bin_dir'] = os.path.join(dirs['abs_test_install_dir'], 'bin')
         dirs['abs_test_bin_plugins_dir'] = os.path.join(dirs['abs_test_bin_dir'],
                                                         'plugins')
         dirs['abs_test_bin_components_dir'] = os.path.join(dirs['abs_test_bin_dir'],
                                                            'components')
@@ -359,16 +360,17 @@ class DesktopUnittest(TestingMixin, Merc
             raw_log_file = os.path.join(dirs['abs_blob_upload_dir'],
                                         '%s_raw.log' % suite)
 
             error_summary_file = os.path.join(dirs['abs_blob_upload_dir'],
                                               '%s_errorsummary.log' % suite)
             str_format_values = {
                 'binary_path': self.binary_path,
                 'symbols_path': self._query_symbols_url(),
+                'abs_work_dir' : dirs['abs_work_dir'],
                 'abs_app_dir': abs_app_dir,
                 'abs_res_dir': abs_res_dir,
                 'raw_log_file': raw_log_file,
                 'error_summary_file': error_summary_file,
                 'gtest_dir': os.path.join(dirs['abs_test_install_dir'],
                                           'gtest'),
                 'abs_work_dir': dirs['abs_work_dir'],
             }
--- a/testing/xpcshell/runxpcshelltests.py
+++ b/testing/xpcshell/runxpcshelltests.py
@@ -945,16 +945,18 @@ class XPCShellTests(object):
         self.env["MOZ_CRASHREPORTER_NO_REPORT"] = "1"
         # Don't permit remote connections by default.
         # MOZ_DISABLE_NONLOCAL_CONNECTIONS can be set to "0" to temporarily
         # enable non-local connections for the purposes of local testing.
         # Don't override the user's choice here.  See bug 1049688.
         self.env.setdefault('MOZ_DISABLE_NONLOCAL_CONNECTIONS', '1')
         if self.mozInfo.get("topsrcdir") is not None:
             self.env["MOZ_DEVELOPER_REPO_DIR"] = self.mozInfo["topsrcdir"].encode()
+        if sys.platform.startswith('linux'):
+            self.env.setdefault('MOZ_DISABLE_CONTENT_SANDBOX', '1')
 
         # Disable the content process sandbox for the xpcshell tests. They
         # currently attempt to do things like bind() sockets, which is not
         # compatible with the sandbox.
         self.env["MOZ_DISABLE_CONTENT_SANDBOX"] = "1"
 
     def buildEnvironment(self):
         """