Closed Bug 1243709 Opened 8 years ago Closed 7 years ago

mach try doesn't grok spaces in test platform specification

Categories

(Testing :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mikedeboer, Assigned: standard8)

References

Details

So the following syntax doesn't work:

mach try -b do -p linux,linux64,macosx64,win32,win64 -u mochitests[Ubuntu,10.6,Windows 7,Windows 8] -t none[Ubuntu,10.6,Windows 7,Windows 8]

It yields the following error:

Error parsing -u argument (['mochitests[Ubuntu,10.6,Windows']):

NB: well done putting the 'mach try is under development, please file bugs blocking 1149670.' message there, super helpful!!
Thank you for the report, I'll take a look.
Assignee: nobody → cmanchester
Argparse treats spaces as significant, even though TryArgumentTokenizer does not, so we have kwargs in the body of the mach command as:

{'builds': 'do',
 'extra_args': ['7,Windows', '8]'],
 'intersection': False,
 'list': False,
 'load': None,
 'paths': ['7,Windows', '8]'],
 'platforms': ['linux,linux64,macosx64,win32,win64'],
 'push': False,
 'save': None,
 'tags': None,
 'talos': ['none[Ubuntu,10.6,Windows'],
 'tests': ['mochitests[Ubuntu,10.6,Windows'],
 'verbose': False}

James, how is this intended to work?
Assignee: cmanchester → nobody
Flags: needinfo?(james)
It's not a great answer but if you quote the argument things should work i.e. something like:

mach try -b do -p linux,linux64,macosx64,win32,win64 -u 'mochitests[Ubuntu,10.6,Windows 7,Windows 8]'

What might work though is to give tests nargs='+' so we get a list of arguments that can then be joined on a space. I haven't tried this to verify if it works though.
Flags: needinfo?(james)
Also, escaping spaces "\ " seems to work as an alternative to solution from comment 3. Example try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=9c8319a800590506d3d69971ec64bc5204c19c24
I've fixed this with slashes in https://github.com/mozilla-releng/services/pull/376. It isn't released yet, but will hopefully be soon.
Assignee: nobody → standard8
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
PR 376 was released to production
You need to log in before you can comment on or make changes to this bug.