Bug 1441484 - fix error handling in make_incremental_updates. r=bhearsum
authorJulien Cristau <jcristau@mozilla.com>
Tue, 27 Feb 2018 10:36:15 +0100
changeset 405584 179c83a1d28b731b2258bfb371247db53f0835f5
parent 405583 ff968c3897dec8295ecf9b4b989375839f30770e
child 405585 bb14b807a77d3383abaa70b7f23bf70953290ae8
push id33525
push usernerli@mozilla.com
push dateWed, 28 Feb 2018 10:11:03 +0000
treeherdermozilla-central@9b1228043619 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhearsum
bugs1441484
milestone60.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 1441484 - fix error handling in make_incremental_updates. r=bhearsum MozReview-Commit-ID: 4jpZqMW0yYX
tools/update-packaging/make_incremental_updates.py
tools/update-packaging/test_make_incremental_updates.py
--- a/tools/update-packaging/make_incremental_updates.py
+++ b/tools/update-packaging/make_incremental_updates.py
@@ -455,17 +455,17 @@ def decode_filename(filepath):
         Or linux-i686/en-US/firefox-3.0b3.complete.mar
         Returns dict with keys product, version, locale, platform, type
     """
     try:
       m = re.search(
         '(?P<product>\w+)(-)(?P<version>\w+\.\w+(\.\w+){0,2})(\.)(?P<locale>.+?)(\.)(?P<platform>.+?)(\.)(?P<type>\w+)(.mar)',
       os.path.basename(filepath))
       return m.groupdict()
-    except Exception(exc):
+    except Exception as exc:
       try:
         m = re.search(
           '(?P<platform>.+?)\/(?P<locale>.+?)\/(?P<product>\w+)-(?P<version>\w+\.\w+)\.(?P<type>\w+).mar',
         filepath)
         return m.groupdict()
       except:
         raise Exception("could not parse filepath %s: %s" % (filepath, exc))
 
--- a/tools/update-packaging/test_make_incremental_updates.py
+++ b/tools/update-packaging/test_make_incremental_updates.py
@@ -140,12 +140,15 @@ class TestMakeIncrementalUpdates(unittes
     """ FIXME touches the filesystem, need refactoring
     def test_get_buildid(self):
         mkup.get_buildid('work_dir', 'platform')
     """
 
     def test_decode_filename(self):
         expected = {'locale': 'lang', 'platform': 'platform', 'product': 'product', 'version': '1.0', 'type': 'complete'}
         self.assertEquals(expected, mkup.decode_filename('product-1.0.lang.platform.complete.mar'))
-        self.assertRaises(Exception, mkup.decode_filename, 'fail')
+        self.assertEquals(expected, mkup.decode_filename('platform/lang/product-1.0.complete.mar'))
+        with self.assertRaises(Exception) as cm:
+            mkup.decode_filename('fail')
+        self.assertTrue(cm.exception.args[0].startswith('could not parse filepath fail:'))
 
 if __name__ == '__main__':
     unittest.main()