Merge bug 617848 to production-0.8 branch. production-0.8
authorLukas Blakk <lsblakk@mozilla.com>
Tue, 04 Jan 2011 10:30:06 -0800
branchproduction-0.8
changeset 1198 532be9b13696
parent 1196 c89fb205ad39 (current diff)
parent 1197 8bd8eccc2c2d (diff)
child 1200 164c9740d9af
push id795
push userlsblakk@mozilla.com
push date2011-01-04 18:30 +0000
bugs617848
Merge bug 617848 to production-0.8 branch.
--- a/test/test_try_parser.py
+++ b/test/test_try_parser.py
@@ -66,22 +66,34 @@ class TestTryParser(unittest.TestCase):
     def test_SpecificPlatform(self):
         # Testing a specific platform, eg: mac only 
         # should specify macosx and macosx64 to get opt and debug
         tm = 'try: -b od -p macosx64,macosx'
         self.customBuilders = TryParser(tm, VALID_BUILDER_NAMES, BUILDER_PRETTY_NAMES)
         builders = ['OS X 10.6.2 tryserver build', 'OS X 10.6.2 tryserver leak test build', 'OS X 10.5.2 tryserver leak test build']
         self.assertEquals(sorted(self.customBuilders), sorted(builders))
 
-    def test_AllPlatforms(self):
+    def test_AllPlatformsBoth(self):
         tm = 'try: -b od -p all'
         self.customBuilders = TryParser(tm, VALID_BUILDER_NAMES, BUILDER_PRETTY_NAMES)
         builders = ['OS X 10.6.2 tryserver build', 'WINNT 5.2 tryserver build', 'Linux x86-64 tryserver build', 'Linux tryserver build', 'OS X 10.5.2 tryserver leak test build', 'OS X 10.6.2 tryserver leak test build', 'WINNT 5.2 tryserver leak test build', 'Linux x86-64 tryserver leak test build', 'Linux tryserver leak test build', 'Android R7 tryserver build', 'Maemo 5 GTK tryserver build']
         self.assertEqual(sorted(self.customBuilders),sorted(builders))
 
+    def test_AllPlatformsOpt(self):
+        tm = 'try: -b o -p all'
+        self.customBuilders = TryParser(tm, VALID_BUILDER_NAMES, BUILDER_PRETTY_NAMES)
+        builders = ['OS X 10.6.2 tryserver build', 'WINNT 5.2 tryserver build', 'Linux x86-64 tryserver build', 'Linux tryserver build', 'Android R7 tryserver build', 'Maemo 5 GTK tryserver build']
+        self.assertEqual(sorted(self.customBuilders),sorted(builders))
+
+    def test_AllPlatformsDebug(self):
+        tm = 'try: -b d -p all'
+        self.customBuilders = TryParser(tm, VALID_BUILDER_NAMES, BUILDER_PRETTY_NAMES)
+        builders = ['OS X 10.5.2 tryserver leak test build', 'OS X 10.6.2 tryserver leak test build', 'WINNT 5.2 tryserver leak test build', 'Linux x86-64 tryserver leak test build', 'Linux tryserver leak test build']
+        self.assertEqual(sorted(self.customBuilders),sorted(builders))
+
     def test_AllTests(self):
         tm = 'try: -b od -p win32 -u all'
         # first test with getBuilders
         self.customBuilders = TryParser(tm, VALID_BUILDER_NAMES + VALID_UPN, BUILDER_PRETTY_NAMES, UNITTEST_PRETTY_NAMES, UNITTEST_SUITES)
         builders = ['WINNT 5.2 tryserver build', 'WINNT 5.2 tryserver leak test build', 'WINNT 5.2 tryserver debug test mochitests-1/5', 'WINNT 5.2 tryserver debug test mochitests-3/5', 'WINNT 5.2 tryserver debug test mochitest-other', 'WINNT 5.2 tryserver debug test reftest', 'WINNT 5.2 tryserver debug test crashtest']
         self.assertEqual(sorted(self.customBuilders),sorted(builders))
         # second test with getTestBuilders
         self.customBuilders = TryParser(tm, VALID_TESTER_NAMES, TESTER_PRETTY_NAMES, None, UNITTEST_SUITES)
--- a/try_parser.py
+++ b/try_parser.py
@@ -39,19 +39,19 @@ def processMessage(message):
     else:
         message =[""]
     return message
 
 def getPlatformBuilders(user_platforms, builderNames, buildTypes, prettyNames):
     platformBuilders = []
 
     if user_platforms != 'none':
-    # if user wants od - the platforms have -debug in them
         for buildType in buildTypes:
             for platform in user_platforms:
+              # add -debug to the platform name
               if buildType == 'debug':
                   platform += '-debug'
               if platform in prettyNames.keys():
                   custom_builder = prettyNames[platform]
                   if custom_builder in builderNames and custom_builder not in platformBuilders:
                       platformBuilders.extend([custom_builder])
     return platformBuilders
 
@@ -145,17 +145,25 @@ def TryParser(message, builderNames, pre
         options.build = ['debug']
     elif options.build == 'o':
         options.build = ['opt']
     else:
         # for any input other than do/od, d, o, all set to default
         options.build = ['opt','debug']
 
     if options.user_platforms == 'all' and prettyNames:
-        options.user_platforms = prettyNames.keys()
+        options.user_platforms = []
+        for buildType in options.build:
+            for platform in prettyNames.keys():
+                if buildType == 'debug' and platform.endswith('debug'):
+                    # append platform with the -debug stripped off
+                    # it gets tacked on in the getPlatformBuilders for buildType == debug
+                    options.user_platforms.append(platform.split('-')[0])
+                elif buildType == 'opt' and not platform.endswith('debug'):
+                    options.user_platforms.append(platform)
     elif options.user_platforms != 'none':
         options.user_platforms = options.user_platforms.split(',')
 
     if unittestSuites:
       if options.test == 'all':
         options.test = unittestSuites
       elif options.test != 'none':
         options.test = expandTestSuites(options.test.split(','), unittestSuites)