Bug 1381577 - Part E; Add assertion that there is no space in each action or option passed to mozharness tests. r=dustin draft
authorJustin Wood <Callek@gmail.com>
Mon, 17 Jul 2017 15:35:02 -0400
changeset 613347 6fb7671f70d2169225d36c0c728324b01b3f055a
parent 613346 0960c34d734a229a77fea2cffa331c69d68f00b6
child 613348 a0f0390f3dcef510f653a5d35963d466befa5ee7
push id69770
push userCallek@gmail.com
push dateFri, 21 Jul 2017 20:09:14 +0000
reviewersdustin
bugs1381577
milestone56.0a1
Bug 1381577 - Part E; Add assertion that there is no space in each action or option passed to mozharness tests. r=dustin Land date changes to support windows nightlies onto central This is needed because on Linux these arrays are joined by a space then passed to the shell as 'for foo in $bar' which will treat spaces as valid delimiters, whereas for windows workers the structure is evaluated completely in python, which means a single value with spaces won't generate the correct command output. Enforcing this prevents mistakes with yaml syntax going unnoticed. MozReview-Commit-ID: 3U4orzyiBuf
taskcluster/taskgraph/transforms/job/mozharness.py
--- a/taskcluster/taskgraph/transforms/job/mozharness.py
+++ b/taskcluster/taskgraph/transforms/job/mozharness.py
@@ -237,19 +237,21 @@ def mozharness_on_generic_worker(config,
     mh_command.append('\\'.join([r'.\build\src\testing', run['script'].replace('/', '\\')]))
     for cfg in run['config']:
         mh_command.append('--config ' + cfg.replace('/', '\\'))
     if run['use-magic-mh-args']:
         mh_command.append('--branch ' + config.params['project'])
         mh_command.append(r'--skip-buildbot-actions')
     mh_command.append(r'--work-dir %cd:Z:=z:%\build')
     for action in run.get('actions', []):
+        assert ' ' not in action
         mh_command.append('--' + action)
 
     for option in run.get('options', []):
+        assert ' ' not in option
         mh_command.append('--' + option)
     if run.get('custom-build-variant-cfg'):
         mh_command.append('--custom-build-variant')
         mh_command.append(run['custom-build-variant-cfg'])
 
     hg_command = ['"c:\\Program Files\\Mercurial\\hg.exe"']
     hg_command.append('robustcheckout')
     hg_command.extend(['--sharebase', 'y:\\hg-shared'])