mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1237958 - Clarify Marionette's behavior re dir/manifest; r=maja_zf
If a user specifies a directory path for Marionette tests, any manifest ('.ini') file(s) in that dir will be ignored and instead all test modules in the dir will be run. Clarify this behavior by logging a warning if an '.ini' file is found in the dir, and expanding help message for the 'tests' argument. MozReview-Commit-ID: KWxXUaO86V2 --HG-- extra : rebase_source : 487235aa5bb678e7a09b176868c08806012761b9
This commit is contained in:
parent
3624359847
commit
05224ab9e0
@ -252,7 +252,11 @@ class BaseMarionetteArguments(ArgumentParser):
|
||||
self.add_argument('tests',
|
||||
nargs='*',
|
||||
default=[],
|
||||
help='Tests to run.')
|
||||
help='Tests to run. '
|
||||
'One or more paths to test files (Python or JS), '
|
||||
'manifest files (.ini) or directories. '
|
||||
'When a directory is specified, '
|
||||
'all test files in the directory will be run.')
|
||||
self.add_argument('-v', '--verbose',
|
||||
action='count',
|
||||
help='Increase verbosity to include debug messages with -v, '
|
||||
@ -889,10 +893,15 @@ setReq.onerror = function() {
|
||||
if os.path.isdir(filepath):
|
||||
for root, dirs, files in os.walk(filepath):
|
||||
for filename in files:
|
||||
if (filename.startswith('test_') and
|
||||
if (filename.endswith('.ini')):
|
||||
msg_tmpl = ("Ignoring manifest '{0}'; running all tests in '{1}'."
|
||||
" See --help for details.")
|
||||
relpath = os.path.relpath(os.path.join(root, filename), filepath)
|
||||
self.logger.warning(msg_tmpl.format(relpath, filepath))
|
||||
elif (filename.startswith('test_') and
|
||||
(filename.endswith('.py') or filename.endswith('.js'))):
|
||||
filepath = os.path.join(root, filename)
|
||||
self.add_test(filepath)
|
||||
test_file = os.path.join(root, filename)
|
||||
self.add_test(test_file)
|
||||
return
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user