# HG changeset patch # User Andrew Halberstadt # Date 1516920406 18000 # Node ID 2ae7d8e3c00eac2646b53953322b1f3c378cf669 # Parent d68b66a07434cb1a21840f82ee6a2b7ca1ab46c1 Bug 1392391 - [reftest] Perform chunking with manifestparser, r=jmaher This replaces reftest's homebrewed chunking algorithm with the one that all the other test harnesses use in manifestparser. For now Android will continue to use the reftest based algorithm. MozReview-Commit-ID: AfUBmQpx3Zz diff --git a/layout/tools/reftest/remotereftest.py b/layout/tools/reftest/remotereftest.py --- a/layout/tools/reftest/remotereftest.py +++ b/layout/tools/reftest/remotereftest.py @@ -278,16 +278,21 @@ class RemoteReftest(RefTest): # move necko cache to a location that can be cleaned up prefs["browser.cache.disk.parent_directory"] = self.remoteCache prefs["layout.css.devPixelsPerPx"] = "1.0" # Because Fennec is a little wacky (see bug 1156817) we need to load the # reftest pages at 1.0 zoom, rather than zooming to fit the CSS viewport. prefs["apz.allow_zooming"] = False + if options.totalChunks: + prefs['reftest.totalChunks'] = options.totalChunks + if options.thisChunk: + prefs['reftest.thisChunk'] = options.thisChunk + # Set the extra prefs. profile.set_preferences(prefs) try: self._devicemanager.pushDir(profileDir, options.remoteProfile) self._devicemanager.chmodDir(options.remoteProfile) except mozdevice.DMError: print "Automation Error: Failed to copy profiledir to device" diff --git a/layout/tools/reftest/runreftest.py b/layout/tools/reftest/runreftest.py --- a/layout/tools/reftest/runreftest.py +++ b/layout/tools/reftest/runreftest.py @@ -31,17 +31,17 @@ import mozcrash import mozdebug import mozfile import mozinfo import mozleak import mozlog import mozprocess import mozprofile import mozrunner -from manifestparser import TestManifest +from manifestparser import TestManifest, filters as mpf from mozrunner.utils import get_stack_fixer_function, test_environment from mozscreenshot import printstatus, dump_screen try: from marionette_driver.addons import Addons from marionette_harness import Marionette except ImportError, e: # Defer ImportError until attempt to use Marionette @@ -283,20 +283,16 @@ class RefTest(object): locations.add_host(server, scheme='http', port=port) locations.add_host(server, scheme='https', port=port) # Set preferences for communication between our command line arguments # and the reftest harness. Preferences that are required for reftest # to work should instead be set in reftest-preferences.js . prefs = prefs or {} prefs['reftest.timeout'] = options.timeout * 1000 - if options.totalChunks: - prefs['reftest.totalChunks'] = options.totalChunks - if options.thisChunk: - prefs['reftest.thisChunk'] = options.thisChunk if options.logFile: prefs['reftest.logFile'] = options.logFile if options.ignoreWindowSize: prefs['reftest.ignoreWindowSize'] = True if options.shuffle: prefs['reftest.shuffle'] = True if options.repeat: prefs['reftest.repeat'] = options.repeat @@ -823,16 +819,19 @@ class RefTest(object): for test in tests: # Name and path are expected by manifestparser, but not used in reftest. test['name'] = test['path'] = test['url1'] mp = TestManifest(strict=False) mp.tests = tests filters = [] + if options.totalChunks: + filters.append(mpf.chunk_by_slice(options.thisChunk, options.totalChunks)) + tests = mp.active_tests(exists=False, filters=filters) return tests def runSerialTests(self, manifests, options, cmdargs=None): debuggerInfo = None if options.debugger: debuggerInfo = mozdebug.get_debugger_info(options.debugger, options.debuggerArgs, options.debuggerInteractive)