Bug 1239808 - Fix mozharness mach command for test_packages.json retrieval. r=jlund
MozReview-Commit-ID: 7jxV7VuI9rS
--- a/testing/mozharness/mach_commands.py
+++ b/testing/mozharness/mach_commands.py
@@ -32,17 +32,17 @@ def get_parser():
help="Extra arguments to pass to mozharness")
return parser
class MozharnessRunner(MozbuildObject):
def __init__(self, *args, **kwargs):
MozbuildObject.__init__(self, *args, **kwargs)
- self.test_packages_url = os.path.join(self.topobjdir, "dist", "test_packages.json")
+ self.test_packages_url = self._test_packages_url()
self.installer_url = self._installer_url()
desktop_unittest_config = [
"--config-file", lambda: self.config_path("unittests",
"%s_unittest.py" % mozinfo.info['os']),
"--config-file", lambda: self.config_path("developer_config.py")]
self.config = {
@@ -166,16 +166,22 @@ class MozharnessRunner(MozbuildObject):
"mac": re.compile("^firefox-\d+\..+\.mac(?:64)?\.dmg$"),
}[mozinfo.info['os']]
dist_path = os.path.join(self.topobjdir, "dist")
filenames = [item for item in os.listdir(dist_path) if
package_re.match(item)]
assert len(filenames) == 1
return self.path_to_url(os.path.join(dist_path, filenames[0]))
+ def _test_packages_url(self):
+ dist_path = os.path.join(self.topobjdir, "dist")
+ filenames = [item for item in os.listdir(dist_path) if
+ item.endswith('test_packages.json')]
+ assert len(filenames) == 1
+ return self.path_to_url(os.path.join(dist_path, filenames[0]))
def config_path(self, *parts):
return self.path_to_url(os.path.join(self.topsrcdir, "testing", "mozharness",
"configs", *parts))
@property
def wpt_config(self):
return "test_config.py" if mozinfo.info['os'] != "win" else "test_config_windows.py"