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
--- 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