Closed
Bug 1212796
Opened 9 years ago
Closed 9 years ago
gaiatest --help throws an exception (and doesn't display the help)
Categories
(Firefox OS Graveyard :: Gaia::UI Tests, defect)
Tracking
(b2g-master affected)
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
b2g-master | --- | affected |
People
(Reporter: jlorenzo, Assigned: jlorenzo)
References
Details
(Keywords: regression)
Attachments
(1 file)
STR
> gaiatest --help
Results:
> Traceback (most recent call last):
> File "/home/jlorenzo/git/gaia/tests/python/gaia-ui-tests/.env/bin/gaiatest", line 9, in <module>
> load_entry_point('gaiatest==0.33', 'console_scripts', 'gaiatest')()
> File "/home/jlorenzo/git/gaia/tests/python/gaia-ui-tests/gaiatest/runtests.py", line 108, in main
> cli(runner_class=GaiaTestRunner, parser_class=GaiaTestArguments)
> File "/home/jlorenzo/git/gaia/tests/python/gaia-ui-tests/.env/lib/python2.7/site-packages/marionette_client-1.0.0-py2.7.egg/marionette/runtests.py", line 51, in cli
> args = parser.parse_args()
> File "/home/jlorenzo/git/gaia/tests/python/gaia-ui-tests/.env/lib/python2.7/site-packages/marionette_client-1.0.0-py2.7.egg/marionette/runner/base.py", line 395, in parse_args
> args = ArgumentParser.parse_args(self, args, values)
> File "/usr/lib64/python2.7/argparse.py", line 1701, in parse_args
> args, argv = self.parse_known_args(args, namespace)
> File "/usr/lib64/python2.7/argparse.py", line 1733, in parse_known_args
> namespace, args = self._parse_known_args(args, namespace)
> File "/usr/lib64/python2.7/argparse.py", line 1939, in _parse_known_args
> start_index = consume_optional(start_index)
> File "/usr/lib64/python2.7/argparse.py", line 1879, in consume_optional
> take_action(action, args, option_string)
> File "/usr/lib64/python2.7/argparse.py", line 1807, in take_action
> action(self, namespace, argument_values, option_string)
> File "/usr/lib64/python2.7/argparse.py", line 996, in __call__
> parser.print_help()
> File "/usr/lib64/python2.7/argparse.py", line 2340, in print_help
> self._print_message(self.format_help(), file)
> File "/usr/lib64/python2.7/argparse.py", line 2314, in format_help
> return formatter.format_help()
> File "/usr/lib64/python2.7/argparse.py", line 281, in format_help
> help = self._root_section.format_help()
> File "/usr/lib64/python2.7/argparse.py", line 211, in format_help
> func(*args)
> File "/usr/lib64/python2.7/argparse.py", line 211, in format_help
> func(*args)
> File "/usr/lib64/python2.7/argparse.py", line 517, in _format_action
> help_text = self._expand_help(action)
> File "/usr/lib64/python2.7/argparse.py", line 603, in _expand_help
> return self._get_help_string(action) % params
> TypeError: %d format: a number is required, not dic
Gaia revision: 7dc70a13a28a28e108b4ec93ed9582cfe85bb984
To make sure I wasn't running on an old gaiatest, I ran
> deactivate; rm -rf .env && virtualenv2 .env && source .env/bin/activate && python setup.py develop
and retried again. I use `virtualenv2`, because on my distribution, python 3 is the default.
Assignee | ||
Comment 1•9 years ago
|
||
I reverted bug 1196489 locally, and gaia displayed the help again.
Blocks: 1196489
Keywords: regression
Comment 3•9 years ago
|
||
Also bug 1212623 was caused by this.
Ideally, we would have some automated tests surrounding command line arguments which would have caused this.
Comment 4•9 years ago
|
||
Assignee | ||
Comment 5•9 years ago
|
||
Comment on attachment 8671342 [details] [review]
[gaia] JohanLorenzo:bug-1212796 > mozilla-b2g:master
It turns out to be a small patch, that was actually documented at [1]:
> Replace strings with implicit arguments such as %default or %prog with the
> standard Python syntax to use dictionaries to format strings, that is,
> %(default)s and %(prog)s.
Sorry, I missed that in the review of bug 1196489.
I performed a |git grep '%default'|, and no more are present after this patch.
[1] https://docs.python.org/2/library/argparse.html#upgrading-optparse-code
Attachment #8671342 -
Flags: review?(pyang)
Attachment #8671342 -
Flags: review?(npark)
Assignee | ||
Comment 6•9 years ago
|
||
(In reply to Martijn Wargers [:mwargers] (QA) from comment #3)
I agree with that. However, I don't see any test for gaiatest itself. Creating some will introduce some work of setting test suite up. Let's put work on that in bug 1212838.
Comment 7•9 years ago
|
||
Comment on attachment 8671342 [details] [review]
[gaia] JohanLorenzo:bug-1212796 > mozilla-b2g:master
good to know that this is now the proper syntax. r+
Attachment #8671342 -
Flags: review?(npark) → review+
Assignee | ||
Comment 8•9 years ago
|
||
Comment on attachment 8671342 [details] [review]
[gaia] JohanLorenzo:bug-1212796 > mozilla-b2g:master
Martijn is currently available for this quick review. Transferring to him.
Attachment #8671342 -
Flags: review?(pyang) → review?(martijn.martijn)
Comment 9•9 years ago
|
||
Comment on attachment 8671342 [details] [review]
[gaia] JohanLorenzo:bug-1212796 > mozilla-b2g:master
Thanks, I tested it for --help and it works with this patch. Thanks for the url at https://docs.python.org/2/library/argparse.html#upgrading-optparse-code
Attachment #8671342 -
Flags: review?(martijn.martijn) → review+
Assignee | ||
Comment 10•9 years ago
|
||
Merged in master at https://github.com/mozilla-b2g/gaia/commit/093b19b1470af0e82fdde4421bfdd1963d857df1
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Comment 11•9 years ago
|
||
Nice catch! Thanks for fixing :D
You need to log in
before you can comment on or make changes to this bug.
Description
•