Bug 1399956 - Add headless mochitests to taskcluster. r?jmaher draft
authorBrendan Dahl <brendan.dahl@gmail.com>
Thu, 28 Sep 2017 11:39:41 -0700
changeset 677772 944b851f03776350c050737202703c6d7e001bfc
parent 677771 067988b9790219c0a772a0e89c3e556497d14906
child 735216 31732f308e2db3d4f62ccedaf1c697fca599af41
push id83803
push userbmo:bdahl@mozilla.com
push dateTue, 10 Oct 2017 18:53:32 +0000
reviewersjmaher
bugs1399956
milestone58.0a1
Bug 1399956 - Add headless mochitests to taskcluster. r?jmaher MozReview-Commit-ID: IGnl6WroOOV
taskcluster/ci/test/test-platforms.yml
taskcluster/ci/test/test-sets.yml
taskcluster/ci/test/tests.yml
testing/mozharness/scripts/desktop_unittest.py
--- a/taskcluster/ci/test/test-platforms.yml
+++ b/taskcluster/ci/test/test-platforms.yml
@@ -36,27 +36,29 @@ linux32-devedition/opt:
         - linux32-opt-tests
 
 linux64/debug:
     build-platform: linux64/debug
     test-sets:
         - common-tests
         - web-platform-tests
         - reftest-stylo
+        - mochitest-headless
 linux64/opt:
     build-platform: linux64/opt
     test-sets:
         - common-tests
         - web-platform-tests
         - opt-only-tests
         - reftest-stylo
         - desktop-screenshot-capture
         - talos
         - linux-talos-stylo-disabled
         - awsy
+        - mochitest-headless
 linux64-nightly/opt:
     build-platform: linux64-nightly/opt
     test-sets:
         - common-tests
         - web-platform-tests
         - opt-only-tests
         - desktop-screenshot-capture
         - awsy
--- a/taskcluster/ci/test/test-sets.yml
+++ b/taskcluster/ci/test/test-sets.yml
@@ -312,8 +312,11 @@ android-gradle-tests:
     - geckoview
 
 android-x86-tests:
     - mochitest-chrome
     - xpcshell
 
 devtools-tests:
     - mochitest-devtools-chrome
+
+mochitest-headless:
+    - mochitest-headless
--- a/taskcluster/ci/test/tests.yml
+++ b/taskcluster/ci/test/tests.yml
@@ -815,16 +815,47 @@ mochitest-gpu:
                 extra-options:
                     - --mochitest-suite=plain-gpu,chrome-gpu,browser-chrome-gpu
     tier:
         by-test-platform:
             linux64-qr/.*: 1
             windows10-64-asan.*: 3
             default: default
 
+mochitest-headless:
+    description: "Mochitest plain headless run"
+    suite: mochitest/plain-chunked
+    treeherder-symbol: tc-M(h)
+    loopback-video: true
+    instance-size: legacy # Bug 1281241: migrating to m3.large instances
+    chunks:
+        by-test-platform:
+            linux.*: 10
+    e10s: true
+    max-run-time: 5400
+    allow-software-gl-layers: false
+    tier: default
+    mozharness:
+        mochitest-flavor: plain
+        script: desktop_unittest.py
+        no-read-buildbot-config: true
+        chunked: true
+        config:
+            by-test-platform:
+                windows.*:
+                    - unittests/win_taskcluster_unittest.py
+                macosx.*:
+                    - unittests/mac_unittest.py
+                linux.*:
+                    - unittests/linux_unittest.py
+                    - remove_executables.py
+        extra-options:
+            - --mochitest-suite=plain-chunked
+            - --headless
+
 mochitest-media:
     description: "Mochitest media run"
     suite: mochitest/mochitest-media
     treeherder-symbol: tc-M(mda)
     max-run-time: 5400
     loopback-video: true
     instance-size:
         by-test-platform:
--- a/testing/mozharness/scripts/desktop_unittest.py
+++ b/testing/mozharness/scripts/desktop_unittest.py
@@ -120,16 +120,22 @@ class DesktopUnittest(TestingMixin, Merc
                     "any other suites.\nBeware, this may take a while ;)"}
          ],
         [['--e10s', ], {
             "action": "store_true",
             "dest": "e10s",
             "default": False,
             "help": "Run tests with multiple processes."}
          ],
+        [['--headless', ], {
+            "action": "store_true",
+            "dest": "headless",
+            "default": False,
+            "help": "Run tests in headless mode."}
+         ],
         [['--no-random', ], {
             "action": "store_true",
             "dest": "no_random",
             "default": False,
             "help": "Run tests with no random intermittents and bisect in case of real failure."}
          ],
         [["--total-chunks"], {
             "action": "store",
@@ -410,16 +416,20 @@ class DesktopUnittest(TestingMixin, Merc
                                  '--this-chunk', c['this_chunk']])
 
             if c['no_random']:
                 if suite_category == "mochitest":
                     base_cmd.append('--bisect-chunk=default')
                 else:
                     self.warning("--no-random does not currently work with suites other than mochitest.")
 
+
+            if c['headless']:
+                base_cmd.append('--headless');
+
             # set pluginsPath
             abs_res_plugins_dir = os.path.join(abs_res_dir, 'plugins')
             str_format_values['test_plugin_path'] = abs_res_plugins_dir
 
             if suite_category not in c["suite_definitions"]:
                 self.fatal("'%s' not defined in the config!")
 
             if suite in ('browser-chrome-coverage', 'xpcshell-coverage',