Bug 1457971 - Support test chunks in runjunit.py and run geckoview-junit in 3 chunks on debug builds; r=me,a=test-only
authorGeoff Brown <gbrown@mozilla.com>
Mon, 30 Apr 2018 17:58:27 -0600
changeset 472495 d94eb310957112cb2cdc177371cfd6c61285e52d
parent 472494 1bfab79dc9a7feb92aea531de3b49efde3f20255
child 472496 d2014da1a457f6397ee8a4f790ffe0b16b8b7f51
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme, test-only
bugs1457971
milestone61.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 1457971 - Support test chunks in runjunit.py and run geckoview-junit in 3 chunks on debug builds; r=me,a=test-only
taskcluster/ci/test/misc.yml
testing/mochitest/runjunit.py
--- a/taskcluster/ci/test/misc.yml
+++ b/taskcluster/ci/test/misc.yml
@@ -23,20 +23,21 @@ geckoview:
 geckoview-junit:
     description: "Geckoview junit run"
     suite: geckoview-junit
     treeherder-symbol: gv-junit
     instance-size: xlarge
     loopback-video: true
     e10s: true
     target: geckoview-androidTest.apk
-    max-run-time:
+    max-run-time: 3600
+    chunks:
         by-test-platform:
-            android.*/debug: 7200
-            android.*/opt: 3600
+            android-4.3-arm7-api-16/debug: 3
+            default: 1
     mozharness:
         script: android_emulator_unittest.py
         no-read-buildbot-config: true
         config:
             by-test-platform:
                 android-4.2-x86/opt:
                     - android/android_common.py
                     - android/androidx86.py
--- a/testing/mochitest/runjunit.py
+++ b/testing/mochitest/runjunit.py
@@ -152,16 +152,22 @@ class JUnitTestRunner(MochitestDesktop):
            Construct and return the 'am instrument' command line.
         """
         cmd = "am instrument -w -r"
         # profile location
         cmd = cmd + " -e args '-profile %s'" % self.remote_profile
         # multi-process
         e10s = 'true' if self.options.e10s else 'false'
         cmd = cmd + " -e use_multiprocess %s" % e10s
+        # chunks (shards)
+        shards = self.options.totalChunks
+        shard = self.options.thisChunk
+        if shards is not None and shard is not None:
+            shard -= 1  # shard index is 0 based
+            cmd = cmd + " -e numShards %d -e shardIndex %d" % (shards, shard)
         # test filters: limit run to specific test(s)
         for f in test_filters:
             # filter can be class-name or 'class-name#method-name' (single test)
             cmd = cmd + " -e class %s" % f
         # environment
         env = {}
         env["MOZ_CRASHREPORTER"] = "1"
         env["MOZ_CRASHREPORTER_NO_REPORT"] = "1"
@@ -360,16 +366,28 @@ class JunitArgumentParser(argparse.Argum
                           help="Path to directory containing breakpad symbols, "
                                "or the URL of a zip file containing symbols.")
         self.add_argument("--utility-path",
                           action="store",
                           type=str,
                           dest="utilityPath",
                           default=None,
                           help="Path to directory containing host utility programs.")
+        self.add_argument("--total-chunks",
+                          action="store",
+                          type=int,
+                          dest="totalChunks",
+                          default=None,
+                          help="Total number of chunks to split tests into.")
+        self.add_argument("--this-chunk",
+                          action="store",
+                          type=int,
+                          dest="thisChunk",
+                          default=None,
+                          help="If running tests by chunks, the chunk number to run.")
         # Additional options for server.
         self.add_argument("--certificate-path",
                           action="store",
                           type=str,
                           dest="certPath",
                           default=None,
                           help="Path to directory containing certificate store."),
         self.add_argument("--http-port",