Bug 1296397 - Add source checkout to web platform test tasks; r=dustin
authorGregory Szorc <gps@mozilla.com>
Wed, 14 Sep 2016 08:20:10 -0700
changeset 355185 4b447ca3c1ae7a6db6483c19120d5f2e0d00e7fc
parent 355184 ab5198e198b5f33ef8f2bb1bea3eb1d3dde677e8
child 355186 79bebd89f7ecab920912b83204abe5efc39570d4
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1296397
milestone51.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 1296397 - Add source checkout to web platform test tasks; r=dustin This commit does a few things. First, it introduces a property on the "test_description" schema that, if defined, will cause run-task to perform a gecko checkout. The presence of the property also configures the needed scopes and caches. Second, we introduce the property on web platform test tasks so a Gecko checkout is present. We also add volumes for the Mercurial paths to the Docker images. We strictly only need this for desktop1604-test since WPT tests don't run on desktop-test. However, desktop-test and desktop1604-test are nearly mirror images of each other and I feel it is best to keep them in sync. This commit will make WPT tasks slower on average because they will need to create a checkout. To add salt to the wound, the checkout isn't used. However, we need to prove that performing checkouts in test tasks in automation works at scale. I'd prefer to have this running for a few weeks and incurring a wall time execution penalty than to have a giant series of commits backed out because source checkouts aren't working. MozReview-Commit-ID: 9UrSWSSmr3w
taskcluster/ci/desktop-test/tests.yml
taskcluster/taskgraph/transforms/tests/make_task_description.py
taskcluster/taskgraph/transforms/tests/test_description.py
testing/docker/desktop-test/Dockerfile
testing/docker/desktop1604-test/Dockerfile
--- a/taskcluster/ci/desktop-test/tests.yml
+++ b/taskcluster/ci/desktop-test/tests.yml
@@ -389,32 +389,34 @@ reftest-no-accel:
 web-platform-tests:
     description: "Web platform test run"
     suite: web-platform-tests
     treeherder-symbol: tc-W()
     chunks: 12
     max-run-time: 7200
     instance-size: xlarge
     docker-image: {"in-tree": "desktop1604-test"}
+    checkout: true
     mozharness:
         script: mozharness/scripts/web_platform_tests.py
         no-read-buildbot-config: true
         config:
             - mozharness/configs/web_platform_tests/prod_config.py
             - mozharness/configs/remove_executables.py
         extra-options:
             - --test-type=testharness
 
 web-platform-tests-reftests:
     description: "Web platform reftest run"
     suite: web-platform-tests-reftests
     treeherder-symbol: tc-W(Wr)
     max-run-time: 5400
     instance-size: xlarge
     docker-image: {"in-tree": "desktop1604-test"}
+    checkout: true
     mozharness:
         script: mozharness/scripts/web_platform_tests.py
         no-read-buildbot-config: true
         config:
             - mozharness/configs/web_platform_tests/prod_config.py
             - mozharness/configs/remove_executables.py
         extra-options:
             - --test-type=reftest
--- a/taskcluster/taskgraph/transforms/tests/make_task_description.py
+++ b/taskcluster/taskgraph/transforms/tests/make_task_description.py
@@ -15,16 +15,19 @@ The test description should be fully for
 transforms, and these transforms should not embody any specific knowledge about
 what should run where. this is the wrong place for special-casing platforms,
 for example - use `all_tests.py` instead.
 """
 
 from __future__ import absolute_import, print_function, unicode_literals
 
 from taskgraph.transforms.base import TransformSequence
+from taskgraph.transforms.job.common import (
+    docker_worker_support_vcs_checkout,
+)
 
 import logging
 
 ARTIFACT_URL = 'https://queue.taskcluster.net/v1/task/{}/artifacts/{}'
 
 ARTIFACTS = [
     # (artifact name prefix, in-image path)
     ("public/logs/", "/home/worker/workspace/build/upload/logs/"),
@@ -152,18 +155,16 @@ def docker_worker_setup(config, test, ta
     worker['caches'] = [{
         'type': 'persistent',
         'name': 'level-{}-{}-test-workspace'.format(
             config.params['level'], config.params['project']),
         'mount-point': "/home/worker/workspace",
     }]
 
     env = worker['env'] = {
-        'GECKO_HEAD_REPOSITORY': config.params['head_repository'],
-        'GECKO_HEAD_REV': config.params['head_rev'],
         'MOZHARNESS_CONFIG': ' '.join(mozharness['config']),
         'MOZHARNESS_SCRIPT': mozharness['script'],
         'MOZHARNESS_URL': {'task-reference': mozharness_url},
         'MOZILLA_BUILD_URL': {'task-reference': installer_url},
         'NEED_PULSEAUDIO': 'true',
         'NEED_WINDOW_MANAGER': 'true',
     }
 
@@ -187,19 +188,26 @@ def docker_worker_setup(config, test, ta
             'docker-worker:relengapi-proxy:tooltool.download.public',
         ])
 
     # assemble the command line
     command = [
         '/home/worker/bin/run-task',
         # The workspace cache/volume is default owned by root:root.
         '--chown', '/home/worker/workspace',
+    ]
+
+    if test['checkout']:
+        docker_worker_support_vcs_checkout(config, test, taskdesc)
+        command.extend(['--vcs-checkout', '/home/worker/checkouts/gecko'])
+
+    command.extend([
         '--',
         '/home/worker/bin/test-linux.sh',
-    ]
+    ])
 
     if mozharness.get('no-read-buildbot-config'):
         command.append("--no-read-buildbot-config")
     command.extend([
         {"task-reference": "--installer-url=" + installer_url},
         {"task-reference": "--test-packages-url=" + test_packages_url},
     ])
     command.extend(mozharness.get('extra-options', []))
--- a/taskcluster/taskgraph/transforms/tests/test_description.py
+++ b/taskcluster/taskgraph/transforms/tests/test_description.py
@@ -114,16 +114,19 @@ test_description_schema = Schema({
 
     # seconds of runtime after which the task will be killed.  Like 'chunks',
     # this can be keyed by test pltaform.
     Required('max-run-time', default=3600): Any(
         int,
         {'by-test-platform': {basestring: int}},
     ),
 
+    # Whether to perform a gecko checkout.
+    Required('checkout', default=False): bool,
+
     # What to run
     Required('mozharness'): Any({
         # the mozharness script used to run this task
         Required('script'): basestring,
 
         # the config files required for the task
         Required('config'): Any(
             [basestring],
--- a/testing/docker/desktop-test/Dockerfile
+++ b/testing/docker/desktop-test/Dockerfile
@@ -22,16 +22,18 @@ RUN bash /setup/system-setup.sh
 ADD topsrcdir/testing/docker/recipes/run-task /home/worker/bin/run-task
 
 # %include taskcluster/scripts/tester/test-ubuntu1204.sh
 ADD topsrcdir/taskcluster/scripts/tester/test-ubuntu1204.sh /home/worker/bin/test-linux.sh
 
 # This will create a host mounted filesystem when the cache is stripped
 # on Try. This cancels out some of the performance losses of aufs. See
 # bug 1291940.
+VOLUME /home/worker/hg-shared
+VOLUME /home/worker/checkouts
 VOLUME /home/worker/workspace
 
 # Set variable normally configured at login, by the shells parent process, these
 # are taken from GNU su manual
 ENV           HOME          /home/worker
 ENV           SHELL         /bin/bash
 ENV           USER          worker
 ENV           LOGNAME       worker
--- a/testing/docker/desktop1604-test/Dockerfile
+++ b/testing/docker/desktop1604-test/Dockerfile
@@ -22,16 +22,18 @@ ADD topsrcdir/testing/docker/recipes/xvf
 ADD topsrcdir/testing/docker/recipes/run-task /home/worker/bin/run-task
 
 # %include taskcluster/scripts/tester/test-ubuntu1604.sh
 ADD topsrcdir/taskcluster/scripts/tester/test-ubuntu1604.sh /home/worker/bin/test-linux.sh
 
 # This will create a host mounted filesystem when the cache is stripped
 # on Try. This cancels out some of the performance losses of aufs. See
 # bug 1291940.
+VOLUME /home/worker/hg-shared
+VOLUME /home/worker/checkouts
 VOLUME /home/worker/workspace
 
 # Set variable normally configured at login, by the shells parent process, these
 # are taken from GNU su manual
 ENV           HOME          /home/worker
 ENV           SHELL         /bin/bash
 ENV           USER          worker
 ENV           LOGNAME       worker