Bug 1243684 - If symbols_url does not exist, let mozcrash auto-detect it on demand. r=jlund
authorHenrik Skupin <mail@hskupin.info>
Thu, 28 Jan 2016 10:54:05 +0100
changeset 282723 61fa62d120b699b31c1ee84876ee40a0e52e5a5f
parent 282722 abfc4b8a1d9274f75683ffe459a3d34386a0f904
child 282724 113fc521664e72b6c2fbf92152551e7e3920c4d0
push id29970
push usercbook@mozilla.com
push dateWed, 03 Feb 2016 10:59:33 +0000
treeherdermozilla-central@f2f8fc172f4c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlund
bugs1243684
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1243684 - If symbols_url does not exist, let mozcrash auto-detect it on demand. r=jlund
testing/mozharness/mozharness/mozilla/testing/testbase.py
--- a/testing/mozharness/mozharness/mozilla/testing/testbase.py
+++ b/testing/mozharness/mozharness/mozilla/testing/testbase.py
@@ -162,24 +162,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