Bug 1470266 - [ci] Schedule serviceworker-e10s mochitest tasks with linux64/debug on mozilla-central, r=jmaher
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Fri, 05 Oct 2018 19:12:27 +0000
changeset 488201 a3d2029e7b26c3ae312b17f7ab11916eec5de355
parent 488200 9a8856c931e52ab1a4c0327011658e44b8342a48
child 488202 f36371c06b5ea5af8133de9bde6a431b5060cc6c
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewersjmaher
bugs1470266
milestone64.0a1
Bug 1470266 - [ci] Schedule serviceworker-e10s mochitest tasks with linux64/debug on mozilla-central, r=jmaher This duplicates all the mochitest, based tests except with dom.serviceWorkers.parent_intercept set to true. For now they are only run on mozilla-central with linux64/debug. Differential Revision: https://phabricator.services.mozilla.com/D7641
devtools/client/application/test/browser.ini
dom/push/test/mochitest.ini
dom/serviceworkers/test/browser.ini
dom/serviceworkers/test/mochitest.ini
taskcluster/ci/config.yml
taskcluster/ci/test/mochitest.yml
testing/mochitest/runrobocop.py
testing/mochitest/runtests.py
testing/mochitest/tests/Harness_sanity/mochitest.ini
toolkit/components/antitracking/test/browser/browser.ini
--- a/devtools/client/application/test/browser.ini
+++ b/devtools/client/application/test/browser.ini
@@ -1,11 +1,12 @@
 [DEFAULT]
 tags = devtools
 subsuite = devtools
+skip-if = serviceworker_e10s
 support-files =
   head.js
   service-workers/debug-sw.js
   service-workers/debug.html
   service-workers/dynamic-registration.html
   service-workers/empty.html
   service-workers/empty-sw.js
   service-workers/scope-page.html
--- a/dom/push/test/mochitest.ini
+++ b/dom/push/test/mochitest.ini
@@ -20,10 +20,11 @@ skip-if = os == "win" # Bug 1373346
 [test_multiple_register_different_scope.html]
 [test_subscription_change.html]
 skip-if = os == "win" # Bug 1373346
 [test_data.html]
 skip-if = os == "win" # Bug 1373346
 [test_try_registering_offline_disabled.html]
 skip-if = os == "win" # Bug 1373346
 [test_serviceworker_lifetime.html]
-skip-if = !e10s || os == "win" # e10s: Bug 1433689, Windows: Bug 1373346
+skip-if = serviceworker_e10s || !e10s || os == "win" # e10s: Bug 1433689, Windows: Bug 1373346
 [test_error_reporting.html]
+skip-if = serviceworker_e10s
--- a/dom/serviceworkers/test/browser.ini
+++ b/dom/serviceworkers/test/browser.ini
@@ -11,18 +11,20 @@ support-files =
   file_userContextId_openWindow.js
   force_refresh_browser_worker.js
   empty.html
   empty.js
   storage_recovery_worker.sjs
   utils.js
 
 [browser_devtools_serviceworker_interception.js]
+skip-if = serviceworker_e10s
 [browser_force_refresh.js]
 [browser_download.js]
 [browser_download_canceled.js]
 skip-if = verify
 [browser_storage_permission.js]
 skip-if = (verify && debug && (os == 'win' || os == 'mac'))
 [browser_storage_recovery.js]
+skip-if = serviceworker_e10s
 [browser_unregister_with_containers.js]
 [browser_userContextId_openWindow.js]
-skip-if = !e10s
+skip-if = !e10s || serviceworker_e10s
--- a/dom/serviceworkers/test/mochitest.ini
+++ b/dom/serviceworkers/test/mochitest.ini
@@ -1,10 +1,11 @@
 [DEFAULT]
 
+skip-if = serviceworker_e10s
 support-files =
   worker.js
   worker2.js
   worker3.js
   fetch_event_worker.js
   parse_error_worker.js
   activate_event_error_worker.js
   install_event_worker.js
--- a/taskcluster/ci/config.yml
+++ b/taskcluster/ci/config.yml
@@ -11,17 +11,19 @@ treeherder:
         'py3': 'Python 3 unit tests'
         'A': 'Android Gradle tests'
         'Fetch-URL': 'Fetch and store content'
         'Fxfn-l': 'Firefox functional tests (local)'
         'Fxfn-l-e10s': 'Firefox functional tests (local) with e10s'
         'Fxfn-r': 'Firefox functional tests (remote)'
         'Fxfn-r-e10s': 'Firefox functional tests (remote) with e10s'
         'M': 'Mochitests'
+        'M-sw': 'Mochitests with serviceworker redesign'
         'M-e10s': 'Mochitests with e10s'
+        'M-sw-e10s': 'Mochitests with serviceworker redesign and e10s'
         'M-V': 'Mochitests on Valgrind'
         'R': 'Reftests'
         'R-sw': 'Reftests with serviceworker redesign enabled'
         'R-e10s': 'Reftests with e10s'
         'R-sw-e10s': 'Reftests with serviceworker redesign and e10s'
         'Rap': 'Raptor performance tests on Firefox'
         'Rap-e10s': 'Raptor performance tests on Firefox with e10s'
         'Rap-C': 'Raptor performance tests on Google Chrome'
--- a/taskcluster/ci/test/mochitest.yml
+++ b/taskcluster/ci/test/mochitest.yml
@@ -2,16 +2,20 @@ job-defaults:
     target:
         by-test-platform:
             android-em-7.0-x86/opt: geckoview-androidTest.apk
             default: null
     tier:
         by-test-platform:
             android-em-7.0-x86/opt: 3
             default: default
+    serviceworker-e10s:
+        by-test-platform:
+            linux64/debug: both
+            default: false
     mozharness:
         script:
             by-test-platform:
                 android-em.*: android_emulator_unittest.py
                 android-hw.*: android_hardware_unittest.py
                 default: desktop_unittest.py
         config:
             by-test-platform:
@@ -351,16 +355,17 @@ mochitest-valgrind:
     run-on-projects: []
     tier: 3
     loopback-video: true
     chunks: 40
     max-run-time: 14400
     # We could re-enable e10s later.
     # There's no intrinsic reason not to use it.
     e10s: false
+    serviceworker-e10s: false
     allow-software-gl-layers: false
     mozharness:
         mochitest-flavor: plain
         chunked: true
 
 mochitest-webgl1-core:
     description: "Mochitest webgl1-core run"
     suite: mochitest/mochitest-webgl1-core
--- a/testing/mochitest/runrobocop.py
+++ b/testing/mochitest/runrobocop.py
@@ -236,16 +236,17 @@ class RobocopTestRunner(MochitestDesktop
 
         # Override the telemetry init delay for integration testing.
         self.options.extraPrefs.append('toolkit.telemetry.initDelay=1')
 
         self.options.extensionsToExclude.extend([
             'mochikit@mozilla.org',
         ])
 
+        self.extraPrefs = self.parseExtraPrefs(self.options.extraPrefs)
         manifest = MochitestDesktop.buildProfile(self, self.options)
         self.localProfile = self.options.profilePath
         self.log.debug("Profile created at %s" % self.localProfile)
         # some files are not needed for robocop; save time by not pushing
         os.remove(os.path.join(self.localProfile, 'userChrome.css'))
         try:
             self.device.push(self.localProfile, self.remoteProfileCopy)
         except Exception:
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -903,17 +903,17 @@ class MochitestDesktop(object):
         self.result = {}
 
         self.start_script = os.path.join(here, 'start_desktop.js')
 
     def environment(self, **kwargs):
         kwargs['log'] = self.log
         return test_environment(**kwargs)
 
-    def extraPrefs(self, prefs):
+    def parseExtraPrefs(self, prefs):
         """Interpolate extra preferences from option strings"""
 
         try:
             prefs = dict(parseKeyValue(prefs, context='--setpref='))
         except KeyValueParseError as e:
             print(str(e))
             sys.exit(1)
 
@@ -1931,17 +1931,17 @@ toolbar#nav-bar {
 
         # Disable web replay rewinding by default if recordings are being saved.
         if options.recordingPath:
             prefs["devtools.recordreplay.enableRewinding"] = False
 
         self.profile.set_preferences(prefs)
 
         # Extra prefs from --setpref
-        self.profile.set_preferences(self.extraPrefs(options.extraPrefs))
+        self.profile.set_preferences(self.extraPrefs)
         return manifest
 
     def getGMPPluginPath(self, options):
         if options.gmp_path:
             return options.gmp_path
 
         gmp_parentdirs = [
             # For local builds, GMP plugins will be under dist/bin.
@@ -2554,23 +2554,30 @@ toolbar#nav-bar {
         self.log.info(':::')
         self.log.info('::: Test verification %s' % finalResult)
         self.log.info(':::')
 
         return 0
 
     def runTests(self, options):
         """ Prepare, configure, run tests and cleanup """
+        self.extraPrefs = self.parseExtraPrefs(options.extraPrefs)
 
         # a11y and chrome tests don't run with e10s enabled in CI. Need to set
         # this here since |mach mochitest| sets the flavor after argument parsing.
         if options.flavor in ('a11y', 'chrome'):
             options.e10s = False
-        mozinfo.update({"e10s": options.e10s})  # for test manifest parsing.
-        mozinfo.update({"headless": options.headless})  # for test manifest parsing.
+
+        # for test manifest parsing.
+        mozinfo.update({
+            "e10s": options.e10s,
+            "headless": options.headless,
+            "serviceworker_e10s": self.extraPrefs.get(
+                'dom.serviceWorkers.parent_intercept', False),
+        })
 
         if options.jscov_dir_prefix is not None:
             mozinfo.update({'coverage': True})
 
         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
@@ -2589,27 +2596,28 @@ toolbar#nav-bar {
 
         # Until we have all green, this does not run on a11y (for perf reasons)
         if not options.runByManifest:
             return self.runMochitests(options, [t['path'] for t in tests])
 
         # code for --run-by-manifest
         manifests = set(t['manifest'] for t in tests)
         result = 0
-        origPrefs = options.extraPrefs[:]
+
+        origPrefs = self.extraPrefs.copy()
         for m in sorted(manifests):
             self.log.info("Running manifest: {}".format(m))
 
             prefs = list(self.prefs_by_manifest[m])[0]
-            options.extraPrefs = origPrefs[:]
+            self.extraPrefs = origPrefs.copy()
             if prefs:
                 prefs = prefs.strip().split()
                 self.log.info("The following extra prefs will be set:\n  {}".format(
                     '\n  '.join(prefs)))
-                options.extraPrefs.extend(prefs)
+                self.extraPrefs.update(self.parseExtraPrefs(prefs))
 
             # If we are using --run-by-manifest, we should not use the profile path (if) provided
             # by the user, since we need to create a new directory for each run. We would face
             # problems if we use the directory provided by the user.
             tests_in_manifest = [t['path'] for t in tests if t['manifest'] == m]
             res = self.runMochitests(options, tests_in_manifest)
             result = result or res
 
@@ -2786,16 +2794,18 @@ toolbar#nav-bar {
                 self.currentTests = [t['path'] for t in tests]
                 testURL = self.buildTestURL(options, scheme=scheme)
 
                 self.buildURLOptions(options, self.browserEnv)
                 if self.urlOpts:
                     testURL += "?" + "&".join(self.urlOpts)
 
                 self.log.info("runtests.py | Running with e10s: {}".format(options.e10s))
+                self.log.info("runtests.py | Running with serviceworker_e10s: {}".format(
+                    mozinfo.info.get('serviceworker_e10s', False)))
                 self.log.info("runtests.py | Running tests: start.\n")
                 ret, _ = self.runApp(
                     testURL,
                     self.browserEnv,
                     options.app,
                     profile=self.profile,
                     extraArgs=options.browserArgs,
                     utilityPath=options.utilityPath,
--- a/testing/mochitest/tests/Harness_sanity/mochitest.ini
+++ b/testing/mochitest/tests/Harness_sanity/mochitest.ini
@@ -5,19 +5,20 @@ skip-if = true #depends on fix for bug 1
 [test_importInMainProcess.html]
 skip-if = verify
 support-files = importtesting_chromescript.js
 [test_sanity.html]
 [test_sanityException.html]
 [test_sanityException2.html]
 [test_sanityParams.html]
 [test_sanityRegisteredServiceWorker.html]
+skip-if = serviceworker_e10s
 support-files = empty.js
 [test_sanityRegisteredServiceWorker2.html]
-skip-if = verify
+skip-if = verify || serviceworker_e10s
 support-files = empty.js
 [test_sanityWindowSnapshot.html]
 [test_SpecialPowersExtension.html]
 [test_SpecialPowersExtension2.html]
 support-files = file_SpecialPowersFrame1.html
 [test_SpecialPowersPushPermissions.html]
 support-files =
     specialPowers_framescript.js
--- a/toolkit/components/antitracking/test/browser/browser.ini
+++ b/toolkit/components/antitracking/test/browser/browser.ini
@@ -14,16 +14,17 @@ support-files =
   empty.js
   popup.html
 
 [browser_backgroundImageAssertion.js]
 [browser_blockingCookies.js]
 support-files = server.sjs
 [browser_blockingIndexedDb.js]
 [browser_blockingStorage.js]
+skip-if = serviceworker_e10s
 [browser_blockingWorkers.js]
 skip-if = (os == "win" && os_version == "6.1" && bits == 32 && !debug) # Bug 1491937
 [browser_blockingMessaging.js]
 [browser_blockingNoOpener.js]
 [browser_existingCookiesForSubresources.js]
 [browser_imageCache1.js]
 [browser_imageCache1-1.js]
 [browser_imageCache1-2.js]
@@ -51,17 +52,21 @@ skip-if = (os == "win" && os_version == 
 [browser_imageCache13-1.js]
 [browser_imageCache13-2.js]
 [browser_imageCache14.js]
 [browser_imageCache14-1.js]
 [browser_imageCache14-2.js]
 [browser_onBeforeRequestNotificationForTrackingResources.js]
 [browser_onModifyRequestNotificationForTrackingResources.js]
 [browser_permissionInNormalWindows.js]
+skip-if = serviceworker_e10s
 [browser_permissionInPrivateWindows.js]
+skip-if = serviceworker_e10s
 [browser_subResources.js]
 support-files = subResources.sjs
 [browser_script.js]
 support-files = tracker.js
 [browser_userInteraction.js]
 [browser_storageAccessPrivateWindow.js]
+skip-if = serviceworker_e10s
 [browser_storageAccessSandboxed.js]
+skip-if = serviceworker_e10s
 [browser_storageAccessWithHeuristics.js]