Bug 1182798 - Set status summary for Firefox UI tests + change exit code. DONTBUILD. r=jlund a=testing
authorArmen Zambrano Gasparnian <armenzg@mozilla.com>
Fri, 24 Jul 2015 10:41:54 -0400
changeset 275447 bcd72a368f81780688f0d6cfbed40f5ecc1f0f7a
parent 275446 7b60354f789266505020094c75f65caa4fd3dc9c
child 275448 6bb14eb443255685083793fdf88617fd01a52aaa
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlund, testing
bugs1182798
milestone40.0
Bug 1182798 - Set status summary for Firefox UI tests + change exit code. DONTBUILD. r=jlund a=testing
testing/mozharness/scripts/firefox_ui_updates.py
--- a/testing/mozharness/scripts/firefox_ui_updates.py
+++ b/testing/mozharness/scripts/firefox_ui_updates.py
@@ -15,16 +15,17 @@ import urllib
 import urllib2
 import sys
 
 # load modules from parent dir
 sys.path.insert(1, os.path.dirname(sys.path[0]))
 
 from mozharness.base.script import PreScriptAction
 from mozharness.mozilla.testing.firefox_ui_tests import FirefoxUITests
+from mozharness.mozilla.buildbot import TBPL_SUCCESS, TBPL_WARNING, EXIT_STATUS_DICT
 
 INSTALLER_SUFFIXES = ('.tar.bz2', '.zip', '.dmg', '.exe', '.apk', '.tar.gz')
 
 class FirefoxUIUpdates(FirefoxUITests):
     # This will be a list containing one item per release based on configs
     # from tools/release/updates/*cfg
     releases = None
     channel = None
@@ -415,21 +416,32 @@ class FirefoxUIUpdates(FirefoxUITests):
                         self.info('python scripts/firefox_ui_updates.py '
                                   '--firefox-ui-branch %s --update-verify-config %s '
                                   '--tools-tag %s --installer-url %s '
                                   '--cfg developer_config.py '
                                   % (self.firefox_ui_branch, self.updates_config_file, self.tools_tag, url))
 
                     results[build_id][locale] = retcode
 
-            self.info("Firefox UI update tests failed locales:")
+            # Determine which locales have failed and set scripts exit code
+            exit_status = TBPL_SUCCESS
             for build_id in sorted(results.keys()):
-                self.info(build_id)
                 failed_locales = []
                 for locale in sorted(results[build_id].keys()):
                     if results[build_id][locale] != 0:
                         failed_locales.append(locale)
-                self.info("  %s" % (', '.join(failed_locales)))
+
+                if failed_locales:
+                    if exit_status == TBPL_SUCCESS:
+                        self.info("")
+                        self.info("SUMMARY - Firefox UI update tests failed locales:")
+                        self.info("=================================================")
+                        exit_status = TBPL_WARNING
+
+                    self.info(build_id)
+                    self.info("  %s" % (', '.join(failed_locales)))
+
+            self.return_code = EXIT_STATUS_DICT[exit_status]
 
 
 if __name__ == '__main__':
     myScript = FirefoxUIUpdates()
     myScript.run_and_exit()