Bug 1308789 - Add test case to reproduce failure draft
authorChris AtLee <catlee@mozilla.com>
Fri, 14 Oct 2016 14:37:26 +0300
changeset 4904 f0a6ae5ec2ed3db10b9be748ee2e569b389df9f2
parent 4903 3d94b250685876721f3171456ce4f4e261a7b099
child 4905 1b12ab7fe739827b7fe8406ae5d42ba3c32cd6a3
push id3648
push usercatlee@mozilla.com
push dateSat, 15 Oct 2016 19:05:51 +0000
bugs1308789
Bug 1308789 - Add test case to reproduce failure MozReview-Commit-ID: KLb4bjBCCsy
test/test_try_parser.py
--- a/test/test_try_parser.py
+++ b/test/test_try_parser.py
@@ -7,17 +7,18 @@ def base_platform(platform):
 
 ###### TEST CASES #####
 
 BUILDER_PRETTY_NAMES = {'macosx64': 'OS X 10.6.2 try build',
                         'macosx64-debug': 'OS X 10.6.2 try leak test build',
                         'macosx-debug': 'OS X 10.5.2 try leak test build',
                         'win32': 'WINNT 5.2 try build',
                         'win32-debug': 'WINNT 5.2 try leak test build',
-                        'win64': 'WINNT 6.1 try try-nondefault build',
+                        'win64': 'WINNT 6.1 try build',
+                        'win64-debug': 'WINNT 6.1 try leak test build',
                         'linux64': 'Linux x86-64 try build',
                         'linux64-debug': 'Linux x86-64 try leak test build',
                         'linux': 'Linux try build',
                         'linux-debug': 'Linux try leak test build',
                         'android-r7': 'Android R7 try build',
                         'maemo5-gtk': 'Maemo 5 GTK try build',
                         }
 # TODO -- need to check on how to separate out the two win32 prettynames
@@ -508,16 +509,39 @@ class TestTryParser(unittest.TestCase):
     def test_bug875252(self):
         tm = 'try: -b do -p win32 -u crashtest[5.1,Windows XP]'
         self.customBuilders = TryParser(tm, VALID_TESTER_NAMES, TESTER_PRETTY_NAMES, None, UNITTEST_SUITES)
         builders = [b for b in self.baselineBuilders
                     if 'crashtest' in b
                     and ('5.1' in b or 'Windows XP' in b)]
         self.assertEqual(sorted(self.customBuilders), sorted(builders))
 
+    def test_bug1308789(self):
+        tm = 'try: -b do -p all -u all[Windows 8,Windows XP]'
+        validTesterNames = ['Windows 8 64-bit try opt test reftest',
+                            'Windows 7 32-bit try opt test reftest',
+                            'Windows XP 32-bit try opt test reftest']
+        testerPrettyNames = {
+            'win64': ['Windows 8 64-bit try-nondefault'],
+            'win32': ['Windows 7 32-bit',
+                      'Windows XP 32-bit try-nondefault'],
+        }
+        unittestSuites = ['reftest']
+
+        customBuilders = TryParser(tm, validTesterNames, testerPrettyNames,
+                                   None, unittestSuites)
+        expectedBuilders = ['Windows 8 64-bit try opt test reftest',
+                            'Windows XP 32-bit try opt test reftest',
+                           ]
+        # The proper behaviour is to have these lists be equal
+        # To reproduce the bug, first test that the results are unequal
+        # Unfortunately trial doesn't handle the unittest.expectedFailure
+        # decorator
+        self.assertNotEqual(sorted(customBuilders), sorted(expectedBuilders))
+
     def test_HiddenCharactersAndOldSyntax(self):
         tm = 'attributes\ntry: -b o -p linux64 -m none -u reftest -t none'
         self.customBuilders = TryParser(tm, VALID_BUILDER_NAMES, BUILDER_PRETTY_NAMES, None, UNITTEST_SUITES)
         builders = [BUILDER_PRETTY_NAMES['linux64']]
         self.assertEqual(sorted(self.customBuilders), sorted(builders))
 
     def test_NoBuildTypeSelected(self):
         tm = 'try: -m none -u crashtest -p win32'