Bug 1342488 - Add an option to mozharness to enable WebRender. r=jmaher draft
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 12 May 2017 15:28:17 -0400
changeset 577069 b4e4a47a95998348b4b499e0aa4ede3ef9159b28
parent 577068 89de1cb9f1128dab09eed2e71b0a177f63f4ff64
child 577070 f413bdade3539c164e3f02ea18c0e56ebf1299bf
push id58591
push userkgupta@mozilla.com
push dateFri, 12 May 2017 19:28:39 +0000
reviewersjmaher
bugs1342488
milestone55.0a1
Bug 1342488 - Add an option to mozharness to enable WebRender. r=jmaher This allows running tests with WebRender enabled, using builds that have WebRender built-in, but not enabled by default. MozReview-Commit-ID: HkFgB09J7gT
testing/mozharness/mozharness/mozilla/testing/firefox_media_tests.py
testing/mozharness/mozharness/mozilla/testing/firefox_ui_tests.py
testing/mozharness/scripts/desktop_unittest.py
testing/mozharness/scripts/marionette.py
testing/mozharness/scripts/web_platform_tests.py
--- a/testing/mozharness/mozharness/mozilla/testing/firefox_media_tests.py
+++ b/testing/mozharness/mozharness/mozilla/testing/firefox_media_tests.py
@@ -79,16 +79,22 @@ media_test_config_options = [
      {'help': 'port to run the browsermob proxy on',
      }],
     [["--allow-software-gl-layers"],
      {"action": "store_true",
       "dest": "allow_software_gl_layers",
       "default": False,
       "help": "Permits a software GL implementation (such as LLVMPipe) to use the GL compositor."
       }],
+    [["--enable-webrender"],
+     {"action": "store_true",
+      "dest": "enable_webrender",
+      "default": False,
+      "help": "Tries to enable the WebRender compositor."}
+      }],
 ] + (copy.deepcopy(testing_config_options))
 
 class JobResultParser(TestSummaryOutputParserHelper):
     """ Parses test output to determine overall result."""
     def __init__(self, **kwargs):
         super(JobResultParser, self).__init__(**kwargs)
         self.return_code = 0
         # External-resource errors that should not count as test failures
@@ -300,16 +306,18 @@ class FirefoxMediaTestsBase(TestingMixin
 
         env = self.query_env()
         if self.query_minidump_stackwalk():
             env['MINIDUMP_STACKWALK'] = self.minidump_stackwalk_path
         env['RUST_BACKTRACE'] = '1'
 
         if self.config['allow_software_gl_layers']:
             env['MOZ_LAYERS_ALLOW_SOFTWARE_GL'] = '1'
+        if self.config['enable_webrender']:
+            env['MOZ_WEBRENDER'] = '1'
 
         return_code = self.run_command(
             cmd,
             output_timeout=self.test_timeout,
             output_parser=self.job_result_parser,
             env=env
         )
         self.job_result_parser.return_code = return_code
--- a/testing/mozharness/mozharness/mozilla/testing/firefox_ui_tests.py
+++ b/testing/mozharness/mozharness/mozilla/testing/firefox_ui_tests.py
@@ -27,16 +27,22 @@ from mozharness.mozilla.vcstools import 
 # General command line arguments for Firefox ui tests
 firefox_ui_tests_config_options = [
     [["--allow-software-gl-layers"], {
         "action": "store_true",
         "dest": "allow_software_gl_layers",
         "default": False,
         "help": "Permits a software GL implementation (such as LLVMPipe) to use the GL compositor.",
     }],
+    [["--enable-webrender"], {
+        "action": "store_true",
+        "dest": "enable_webrender",
+        "default": False,
+        "help": "Tries to enable the WebRender compositor.",
+    }],
     [['--dry-run'], {
         'dest': 'dry_run',
         'default': False,
         'help': 'Only show what was going to be tested.',
     }],
     [["--e10s"], {
         'dest': 'e10s',
         'action': 'store_true',
@@ -249,16 +255,18 @@ class FirefoxUITests(TestingMixin, VCSTo
         env['RUST_BACKTRACE'] = '1'
 
         # If code coverage is enabled, set GCOV_PREFIX env variable
         if self.config.get('code_coverage'):
             env['GCOV_PREFIX'] = self.gcov_dir
 
         if self.config['allow_software_gl_layers']:
             env['MOZ_LAYERS_ALLOW_SOFTWARE_GL'] = '1'
+        if self.config['enable_webrender']:
+            env['MOZ_WEBRENDER'] = '1'
 
         return_code = self.run_command(cmd,
                                        cwd=dirs['abs_work_dir'],
                                        output_timeout=300,
                                        output_parser=parser,
                                        env=env)
 
         tbpl_status, log_level = parser.evaluate_parser(return_code)
--- a/testing/mozharness/scripts/desktop_unittest.py
+++ b/testing/mozharness/scripts/desktop_unittest.py
@@ -151,16 +151,22 @@ class DesktopUnittest(TestingMixin, Merc
             "help": "Permits a software GL implementation (such as LLVMPipe) to use the GL compositor."}
          ],
         [["--parallel-stylo-traversal"], {
             "action": "store_true",
             "dest": "parallel_stylo_traversal",
             "default": False,
             "help": "Forcibly enable parallel traversal in Stylo with STYLO_THREADS=4"}
          ],
+        [["--enable-webrender"], {
+            "action": "store_true",
+            "dest": "enable_webrender",
+            "default": False,
+            "help": "Tries to enable the WebRender compositor."}
+         ],
     ] + copy.deepcopy(testing_config_options) + \
         copy.deepcopy(blobupload_config_options) + \
         copy.deepcopy(code_coverage_config_options)
 
     def __init__(self, require_config_file=True):
         # abs_dirs defined already in BaseScript but is here to make pylint happy
         self.abs_dirs = None
         super(DesktopUnittest, self).__init__(
@@ -705,16 +711,19 @@ class DesktopUnittest(TestingMixin, Merc
                 env['MOZ_UPLOAD_DIR'] = self.query_abs_dirs()['abs_blob_upload_dir']
                 env['MINIDUMP_SAVE_PATH'] = self.query_abs_dirs()['abs_blob_upload_dir']
                 env['RUST_BACKTRACE'] = '1'
                 if not os.path.isdir(env['MOZ_UPLOAD_DIR']):
                     self.mkdir_p(env['MOZ_UPLOAD_DIR'])
 
                 if self.config['allow_software_gl_layers']:
                     env['MOZ_LAYERS_ALLOW_SOFTWARE_GL'] = '1'
+                if self.config['enable_webrender']:
+                    env['MOZ_WEBRENDER'] = '1'
+
                 env['STYLO_THREADS'] = '4' if self.config['parallel_stylo_traversal'] else '1'
 
                 env = self.query_env(partial_env=env, log_level=INFO)
                 cmd_timeout = self.get_timeout_for_category(suite_category)
                 return_code = self.run_command(cmd, cwd=dirs['abs_work_dir'],
                                                output_timeout=cmd_timeout,
                                                output_parser=parser,
                                                env=env)
--- a/testing/mozharness/scripts/marionette.py
+++ b/testing/mozharness/scripts/marionette.py
@@ -92,16 +92,23 @@ class MarionetteTest(TestingMixin, Mercu
          }
     ], [
        ["--allow-software-gl-layers"],
        {"action": "store_true",
         "dest": "allow_software_gl_layers",
         "default": False,
         "help": "Permits a software GL implementation (such as LLVMPipe) to use the GL compositor."
         }
+    ], [
+       ["--enable-webrender"],
+       {"action": "store_true",
+        "dest": "enable_webrender",
+        "default": False,
+        "help": "Tries to enable the WebRender compositor."
+        }
      ]] + copy.deepcopy(testing_config_options) \
         + copy.deepcopy(blobupload_config_options) \
         + copy.deepcopy(code_coverage_config_options)
 
     error_list = [
         {'substr': 'FAILED (errors=', 'level': WARNING},
         {'substr': r'''Could not successfully complete transport of message to Gecko, socket closed''', 'level': ERROR},
         {'substr': r'''Connection to Marionette server is lost. Check gecko''', 'level': ERROR},
@@ -306,16 +313,18 @@ class MarionetteTest(TestingMixin, Mercu
         if self.query_minidump_stackwalk():
             env['MINIDUMP_STACKWALK'] = self.minidump_stackwalk_path
         env['MOZ_UPLOAD_DIR'] = self.query_abs_dirs()['abs_blob_upload_dir']
         env['MINIDUMP_SAVE_PATH'] = self.query_abs_dirs()['abs_blob_upload_dir']
         env['RUST_BACKTRACE'] = '1'
 
         if self.config['allow_software_gl_layers']:
             env['MOZ_LAYERS_ALLOW_SOFTWARE_GL'] = '1'
+        if self.config['enable_webrender']:
+            env['MOZ_WEBRENDER'] = '1'
 
         if not os.path.isdir(env['MOZ_UPLOAD_DIR']):
             self.mkdir_p(env['MOZ_UPLOAD_DIR'])
         env = self.query_env(partial_env=env)
 
         marionette_parser = self.parser_class(config=self.config,
                                               log_obj=self.log_obj,
                                               error_list=self.error_list,
--- a/testing/mozharness/scripts/web_platform_tests.py
+++ b/testing/mozharness/scripts/web_platform_tests.py
@@ -47,17 +47,24 @@ class WebPlatformTest(TestingMixin, Merc
             "action": "store",
             "dest": "this_chunk",
             "help": "Number of this chunk"}
          ],
         [["--allow-software-gl-layers"], {
             "action": "store_true",
             "dest": "allow_software_gl_layers",
             "default": False,
-            "help": "Permits a software GL implementation (such as LLVMPipe) to use the GL compositor."}]
+            "help": "Permits a software GL implementation (such as LLVMPipe) to use the GL compositor."}
+         ],
+        [["--enable-webrender"], {
+            "action": "store_true",
+            "dest": "enable_webrender",
+            "default": False,
+            "help": "Tries to enable the WebRender compositor."}
+         ]
     ] + copy.deepcopy(testing_config_options) + \
         copy.deepcopy(blobupload_config_options) + \
         copy.deepcopy(code_coverage_config_options)
 
     def __init__(self, require_config_file=True):
         super(WebPlatformTest, self).__init__(
             config_options=self.config_options,
             all_actions=[
@@ -240,16 +247,18 @@ class WebPlatformTest(TestingMixin, Merc
                                         log_obj=self.log_obj,
                                         log_compact=True)
 
         env = {'MINIDUMP_SAVE_PATH': dirs['abs_blob_upload_dir']}
         env['RUST_BACKTRACE'] = '1'
 
         if self.config['allow_software_gl_layers']:
             env['MOZ_LAYERS_ALLOW_SOFTWARE_GL'] = '1'
+        if self.config['enable_webrender']:
+            env['MOZ_WEBRENDER'] = '1'
 
         env = self.query_env(partial_env=env, log_level=INFO)
 
         return_code = self.run_command(cmd,
                                        cwd=dirs['abs_work_dir'],
                                        output_timeout=1000,
                                        output_parser=parser,
                                        env=env)