Bug 1239808 - Fix mozharness mach command for test_packages.json retrieval. r=jlund draft
authorHenrik Skupin <mail@hskupin.info>
Thu, 25 Feb 2016 21:45:25 +0100
changeset 334672 291b561ba9e79ea46efb901ae87abd3761d08e2c
parent 334671 6d1e43d6160c6912ab577a1f18091dc7a7925e49
child 514968 184e6f4a5933f58c03485d99efba81e4a66ca720
push id11607
push userbmo:hskupin@gmail.com
push dateThu, 25 Feb 2016 20:51:19 +0000
reviewersjlund
bugs1239808
milestone47.0a1
Bug 1239808 - Fix mozharness mach command for test_packages.json retrieval. r=jlund MozReview-Commit-ID: 7jxV7VuI9rS
testing/mozharness/mach_commands.py
--- 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"