Bug 1243684 - If symbols_url does not exist, let mozcrash auto-detect it on demand. r=jlund, a=test-only
authorHenrik Skupin <mail@hskupin.info>
Thu, 28 Jan 2016 10:54:05 +0100
changeset 311389 d21b40099aa0294775000d89746b28bfea4d4591
parent 311388 aff9cfe1c67a7b874cf485fb23d3bc46d12abede
child 311390 7190c35c9e14fc0e7f642e26ef1e8aa4becd8983
push id5671
push usercbook@mozilla.com
push dateWed, 24 Feb 2016 15:52:52 +0000
treeherdermozilla-beta@d21b40099aa0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlund, test-only
bugs1243684
milestone45.0
Bug 1243684 - If symbols_url does not exist, let mozcrash auto-detect it on demand. r=jlund, a=test-only
testing/mozharness/mozharness/mozilla/testing/testbase.py
--- a/testing/mozharness/mozharness/mozilla/testing/testbase.py
+++ b/testing/mozharness/mozharness/mozilla/testing/testbase.py
@@ -154,24 +154,37 @@ class TestingMixin(VirtualenvMixin, Buil
         last_slash = reference_url.rfind('/')
         base_url = reference_url[:last_slash]
 
         return '%s/%s' % (base_url, file_name)
 
     def query_symbols_url(self):
         if self.symbols_url:
             return self.symbols_url
-        if not self.installer_url:
+
+        elif self.installer_url:
+            symbols_url = None
+            for suffix in INSTALLER_SUFFIXES:
+                if self.installer_url.endswith(suffix):
+                    symbols_url = self.installer_url[:-len(suffix)] + '.crashreporter-symbols.zip'
+                    break
+
+            # Check if the URL exists. If not, use none to allow mozcrash to auto-check for symbols
+            try:
+                if symbols_url:
+                    self._urlopen(symbols_url)
+                    self.symbols_url = symbols_url
+            except urllib2.URLError:
+                self.warning("Can't figure out symbols_url from installer_url: %s!" %
+                             self.installer_url)
+
+        else:
             self.fatal("Can't figure out symbols_url without an installer_url!")
-        for suffix in INSTALLER_SUFFIXES:
-            if self.installer_url.endswith(suffix):
-                self.symbols_url = self.installer_url[:-len(suffix)] + '.crashreporter-symbols.zip'
-                return self.symbols_url
-        else:
-            self.fatal("Can't figure out symbols_url from installer_url %s!" % self.installer_url)
+
+        return self.symbols_url
 
     def _pre_config_lock(self, rw_config):
         for i, (target_file, target_dict) in enumerate(rw_config.all_cfg_files_and_dicts):
             if 'developer_config' in target_file:
                 self._developer_mode_changes(rw_config)
 
     def _developer_mode_changes(self, rw_config):
         """ This function is called when you append the config called