--- a/tools/tryselect/selectors/syntax.py
+++ b/tools/tryselect/selectors/syntax.py
@@ -64,16 +64,22 @@ class SyntaxParser(BaseTryParser):
}],
[['-v', '--verbose'],
{'dest': 'verbose',
'action': 'store_true',
'default': False,
'help': 'Print detailed information about the resulting test selection '
'and commands performed.',
}],
+ [['--detect-paths'],
+ {'dest': 'detect_paths',
+ 'action': 'store_true',
+ 'default': False,
+ 'help': 'Provide test paths based on files changed in the working copy.',
+ }],
]
# Arguments we will accept on the command line and pass through to try
# syntax with no further intervention. The set is taken from
# http://trychooser.pub.build.mozilla.org with a few additions.
#
# Note that the meaning of store_false and store_true arguments is
# not preserved here, as we're only using these to echo the literal
@@ -449,20 +455,20 @@ class AutoTry(object):
parts.append(arg)
parts.append(e)
if action in ('store_true', 'store_false'):
parts.append(arg)
try_syntax = " ".join(parts)
return try_syntax
- def find_paths_and_tags(self, verbose):
+ def find_paths_and_tags(self, verbose, detect_paths):
paths, tags = set(), set()
changed_files = self.vcs.files_changed
- if changed_files:
+ if changed_files and detect_paths:
if verbose:
print("Pushing tests based on modifications to the "
"following files:\n\t%s" % "\n\t".join(changed_files))
from mozbuild.frontend.reader import (
BuildReader,
EmptyConfig,
)
@@ -575,17 +581,18 @@ class AutoTry(object):
print("No saved configuration called %s found in autotry.ini" % kwargs["preset"],
file=sys.stderr)
for key, value in kwargs.iteritems():
if value in (None, []) and key in defaults:
kwargs[key] = defaults[key]
if not any(kwargs[item] for item in ("paths", "tests", "tags")):
- kwargs["paths"], kwargs["tags"] = self.find_paths_and_tags(kwargs["verbose"])
+ kwargs["paths"], kwargs["tags"] = self.find_paths_and_tags(kwargs["verbose"],
+ kwargs["detect_paths"])
builds, platforms, tests, talos, jobs, paths, tags, extra = self.validate_args(**kwargs)
if paths or tags:
paths = [os.path.relpath(os.path.normpath(os.path.abspath(item)), self.topsrcdir)
for item in paths]
paths_by_flavor = self.paths_by_flavor(paths=paths, tags=tags)