Bug 1397406 - Use BuildReader helper in `mach test`; r?dustin draft
authorGregory Szorc <gps@mozilla.com>
Wed, 06 Sep 2017 12:26:15 -0700
changeset 660269 da73ea2a49ccf82a3efe28083c3aaec7940812b1
parent 660268 30f638f3ca496580e66761645a6144d4885e99ab
child 730181 2f3b233bee262a556aa735d0a4b3cc375951edd7
push id78341
push usergszorc@mozilla.com
push dateWed, 06 Sep 2017 19:34:49 +0000
reviewersdustin
bugs1397406
milestone57.0a1
Bug 1397406 - Use BuildReader helper in `mach test`; r?dustin Now that we have a helper function to obtain a BuildReader, let's put it to use. MozReview-Commit-ID: 7V3RsWs5TPu
testing/mach_commands.py
--- a/testing/mach_commands.py
+++ b/testing/mach_commands.py
@@ -264,22 +264,17 @@ class Test(MachCommandBase):
             # introduced in bug 1185599.
             from autotry import AutoTry
             at = AutoTry(self.topsrcdir, resolver, self._mach_context)
             changed_files = at.find_changed_files()
             if changed_files:
                 print("Tests will be run based on modifications to the "
                       "following files:\n\t%s" % "\n\t".join(changed_files))
 
-            from mozbuild.frontend.reader import (
-                BuildReader,
-                EmptyConfig,
-            )
-            config = EmptyConfig(self.topsrcdir)
-            reader = BuildReader(config)
+            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