Bug 1410969 - Properly import AutoTry; r=ahal
authorGregory Szorc <gps@mozilla.com>
Mon, 23 Oct 2017 10:33:37 -0700
changeset 387966 f4058e6c62b38bc59553503031de84290dcf3b79
parent 387965 1814b6aba6e3e8711ebbe974dfebe31e6cb27a40
child 387967 7506fda0a6e750808ee7ddfadf6eb4b4d92699bf
push id32739
push useracraciun@mozilla.com
push dateWed, 25 Oct 2017 09:29:21 +0000
treeherdermozilla-central@252a8528c5ab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal
bugs1410969, 1382775
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1410969 - Properly import AutoTry; r=ahal The AutoTry code got moved around in 27b5181a3c77 and c94bf66df122 (bug 1382775). This broke `mach test` without arguments. This commit imports the new location and uses the new API. As the inline TODO states, there is still room for improvement. This will be done in a separate commit. MozReview-Commit-ID: AKHfdNnfOhl
testing/mach_commands.py
--- a/testing/mach_commands.py
+++ b/testing/mach_commands.py
@@ -249,26 +249,25 @@ class Test(MachCommandBase):
             relpath = self._wrap_path_argument(entry).relpath()
             tests = list(resolver.resolve_tests(paths=[relpath]))
             run_tests.extend(tests)
 
             if not tests:
                 print('UNKNOWN TEST: %s' % entry, file=sys.stderr)
 
         if not what:
-            # TODO: This isn't really related to try, and should be
-            # extracted to a common library for vcs interactions when it is
-            # introduced in bug 1185599.
-            from autotry import AutoTry
+            from tryselect.selectors.syntax import AutoTry
             at = AutoTry(self.topsrcdir, resolver, self._mach_context)
-            changed_files = at.find_changed_files()
+            changed_files, changed_tags = at.find_paths_and_tags(
+                False, detect_paths=True)
             if changed_files:
                 print("Tests will be run based on modifications to the "
                       "following files:\n\t%s" % "\n\t".join(changed_files))
 
+            # TODO this code is redundant with what `find_paths_and_tags` does.
             reader = self.mozbuild_reader(config_mode='empty')
             files_info = reader.files_info(changed_files)
 
             paths, tags, flavors = set(), set(), set()
             for info in files_info.values():
                 paths |= info.test_files
                 tags |= info.test_tags
                 flavors |= info.test_flavors