Bug 1294234 - Assign command at end of function; r=dustin
authorGregory Szorc <gps@mozilla.com>
Tue, 09 Aug 2016 13:20:05 -0700
changeset 309293 c72df0f64a7f221f67205aba1d6321f4365ccf5a
parent 309292 527ab73d66dcba30fe0ed4d04aad31142b60a037
child 309294 25bc6ca8f19ffb1c8419fe441c341202991bb85c
push id30560
push userkwierso@gmail.com
push dateMon, 15 Aug 2016 21:07:46 +0000
treeherdermozilla-central@7b74ee1d97db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1294234
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 1294234 - Assign command at end of function; r=dustin Previously, the code performed a "hidden" assignment to worker['command'] when creating the "command" variable. This tripped me up when reading the code because relying on variable references isn't exactly obvious. We now defer the assignment to worker['command'] until the end, making the code a little easier to understand. MozReview-Commit-ID: 23qH4Z3RKY4
taskcluster/taskgraph/transforms/tests/make_task_description.py
--- a/taskcluster/taskgraph/transforms/tests/make_task_description.py
+++ b/taskcluster/taskgraph/transforms/tests/make_task_description.py
@@ -188,17 +188,17 @@ def docker_worker_setup(config, test, ta
         })
         taskdesc['scopes'].extend([
             'docker-worker:relengapi-proxy:tooltool.download.internal',
             'docker-worker:relengapi-proxy:tooltool.download.public',
         ])
 
     # assemble the command line
 
-    command = worker['command'] = ["bash", "/home/worker/bin/test.sh"]
+    command = ["bash", "/home/worker/bin/test.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', []))
 
@@ -213,8 +213,10 @@ def docker_worker_setup(config, test, ta
             for i, c in enumerate(command):
                 if isinstance(c, basestring) and c.startswith('--test-suite'):
                     command[i] += suffix
 
     if 'download-symbols' in mozharness:
         download_symbols = mozharness['download-symbols']
         download_symbols = {True: 'true', False: 'false'}.get(download_symbols, download_symbols)
         command.append('--download-symbols=' + download_symbols)
+
+    worker['command'] = command