Bug 1558598 - Ensure mozinfo correctly detects WebRender. r=ahal
authorKartikaya Gupta <kgupta@mozilla.com>
Sat, 29 Jun 2019 09:51:14 +0000
changeset 543526 fe0e4450ad1a669636d41f1d282bacfbb1262c41
parent 543525 67f20ed19e3ee867e29a94bce1c30c293ad6ed87
child 543527 c1412fac36f8232643fee1db9a994b0228894d75
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal
bugs1558598
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1558598 - Ensure mozinfo correctly detects WebRender. r=ahal I don't know if this covers all the things that use mozinfo (probably not) but it covers all the suites that use mozinfo and have webrender conditions in the test manifests (i.e. mochitest and wpt variants). Differential Revision: https://phabricator.services.mozilla.com/D35869
build/docs/mozinfo.rst
testing/mochitest/runtests.py
testing/mozbase/mozinfo/mozinfo/mozinfo.py
testing/web-platform/tests/tools/wptrunner/wptrunner/wptrunner.py
testing/web-platform/tests/tools/wptrunner/wptrunner/wpttest.py
testing/xpcshell/runxpcshelltests.py
--- a/build/docs/mozinfo.rst
+++ b/build/docs/mozinfo.rst
@@ -162,8 +162,15 @@ toolkit
    ``MOZ_WIDGET_TOOLKIT`` ``config.status`` variable.
 
    Always defined.
 
 topsrcdir
    The path to the source directory the build came from.
 
    Always defined.
+
+webrender
+   Whether or not WebRender is enabled as the Gecko compositor.
+
+   Values are ``true`` and ``false``.
+
+   Always defined.
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -2589,16 +2589,17 @@ toolbar#nav-bar {
         mozinfo.update({
             "e10s": options.e10s,
             "fission": self.extraPrefs.get('fission.autostart', False),
             "headless": options.headless,
             "serviceworker_e10s": self.extraPrefs.get(
                 'dom.serviceWorkers.parent_intercept', False),
             "socketprocess_e10s": self.extraPrefs.get(
                 'network.process.enabled', False),
+            "webrender": options.enable_webrender,
         })
 
         self.setTestRoot(options)
 
         # Despite our efforts to clean up servers started by this script, in practice
         # we still see infrequent cases where a process is orphaned and interferes
         # with future tests, typically because the old server is keeping the port in use.
         # Try to avoid those failures by checking for and killing servers before
--- a/testing/mozbase/mozinfo/mozinfo/mozinfo.py
+++ b/testing/mozbase/mozinfo/mozinfo/mozinfo.py
@@ -61,17 +61,17 @@ def get_windows_version():
 
 # get system information
 info = {'os': unknown,
         'processor': unknown,
         'version': unknown,
         'os_version': unknown,
         'bits': unknown,
         'has_sandbox': unknown,
-        'webrender': bool(os.environ.get("MOZ_WEBRENDER", False)),
+        'webrender': False,
         'automation': bool(os.environ.get("MOZ_AUTOMATION", False)),
         }
 (system, node, release, version, machine, processor) = platform.uname()
 (bits, linkage) = platform.architecture()
 
 # get os information and related data
 if system in ["Microsoft", "Windows"]:
     info['os'] = 'win'
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/wptrunner.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/wptrunner.py
@@ -47,17 +47,18 @@ def get_loader(test_paths, product, debu
     if run_info_extras is None:
         run_info_extras = {}
 
     run_info = wpttest.get_run_info(kwargs["run_info"], product,
                                     browser_version=kwargs.get("browser_version"),
                                     browser_channel=kwargs.get("browser_channel"),
                                     verify=kwargs.get("verify"),
                                     debug=debug,
-                                    extras=run_info_extras)
+                                    extras=run_info_extras,
+                                    enable_webrender=kwargs.get("enable_webrender"))
 
     test_manifests = testloader.ManifestLoader(test_paths, force_manifest_update=kwargs["manifest_update"],
                                                manifest_download=kwargs["manifest_download"]).load()
 
     manifest_filters = []
 
     if kwargs["include"] or kwargs["exclude"] or kwargs["include_manifest"] or kwargs["default_exclude"]:
         manifest_filters.append(testloader.TestFilter(include=kwargs["include"],
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/wpttest.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/wpttest.py
@@ -67,17 +67,18 @@ def get_run_info(metadata_root, product,
     return RunInfo(metadata_root, product, **kwargs)
 
 
 class RunInfo(dict):
     def __init__(self, metadata_root, product, debug,
                  browser_version=None,
                  browser_channel=None,
                  verify=None,
-                 extras=None):
+                 extras=None,
+                 enable_webrender=False):
         import mozinfo
         self._update_mozinfo(metadata_root)
         self.update(mozinfo.info)
 
         from update.tree import GitTree
         try:
             # GitTree.__init__ throws if we are not in a git tree.
             rev = GitTree(log_error=False).rev
@@ -97,16 +98,17 @@ class RunInfo(dict):
         if browser_channel:
             self["browser_channel"] = browser_channel
 
         self["verify"] = verify
         if "wasm" not in self:
             self["wasm"] = False
         if extras is not None:
             self.update(extras)
+        self["webrender"] = enable_webrender
 
     def _update_mozinfo(self, metadata_root):
         """Add extra build information from a mozinfo.json file in a parent
         directory"""
         import mozinfo
 
         path = metadata_root
         dirs = set()
--- a/testing/xpcshell/runxpcshelltests.py
+++ b/testing/xpcshell/runxpcshelltests.py
@@ -1212,16 +1212,17 @@ class XPCShellTests(object):
             if isinstance(k, unicode):
                 k = k.encode('ascii')
             fixedInfo[k] = v
         self.mozInfo = fixedInfo
 
         self.mozInfo['fission'] = prefs.get('fission.autostart', False)
         self.mozInfo['serviceworker_e10s'] = prefs.get(
             'dom.serviceWorkers.parent_intercept', False)
+        self.mozInfo['webrender'] = self.enable_webrender
 
         mozinfo.update(self.mozInfo)
 
         return True
 
     def runTests(self, options, testClass=XPCShellTestThread, mobileArgs=None):
         """
           Run xpcshell tests.