OLD | NEW |
1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 test_dict = test_run_results._interpret_test_failures([test_failures.Fai
lureMissingImageHash()]) | 172 test_dict = test_run_results._interpret_test_failures([test_failures.Fai
lureMissingImageHash()]) |
173 self.assertIn('is_missing_image', test_dict) | 173 self.assertIn('is_missing_image', test_dict) |
174 | 174 |
175 | 175 |
176 class SummarizedResultsTest(unittest.TestCase): | 176 class SummarizedResultsTest(unittest.TestCase): |
177 def setUp(self): | 177 def setUp(self): |
178 host = MockHost(initialize_scm_by_default=False) | 178 host = MockHost(initialize_scm_by_default=False) |
179 self.port = host.port_factory.get(port_name='test') | 179 self.port = host.port_factory.get(port_name='test') |
180 | 180 |
181 def test_no_svn_revision(self): | 181 def test_no_chromium_revision(self): |
182 summary = summarized_results(self.port, expected=False, passing=False, f
laky=False) | 182 summary = summarized_results(self.port, expected=False, passing=False, f
laky=False) |
183 self.assertNotIn('revision', summary) | 183 self.assertNotIn('revision', summary) |
184 | 184 |
185 def test_num_failures_by_type(self): | 185 def test_num_failures_by_type(self): |
186 summary = summarized_results(self.port, expected=False, passing=False, f
laky=False) | 186 summary = summarized_results(self.port, expected=False, passing=False, f
laky=False) |
187 self.assertEquals(summary['num_failures_by_type'], {'CRASH': 1, 'MISSING
': 0, 'TEXT': 1, 'IMAGE': 1, 'NEEDSREBASELINE': 0, 'NEEDSMANUALREBASELINE': 0, '
PASS': 0, 'REBASELINE': 0, 'SKIP': 0, 'SLOW': 0, 'TIMEOUT': 3, 'IMAGE+TEXT': 0,
'LEAK': 0, 'FAIL': 0, 'AUDIO': 0, 'WONTFIX': 1}) | 187 self.assertEquals(summary['num_failures_by_type'], {'CRASH': 1, 'MISSING
': 0, 'TEXT': 1, 'IMAGE': 1, 'NEEDSREBASELINE': 0, 'NEEDSMANUALREBASELINE': 0, '
PASS': 0, 'REBASELINE': 0, 'SKIP': 0, 'SLOW': 0, 'TIMEOUT': 3, 'IMAGE+TEXT': 0,
'LEAK': 0, 'FAIL': 0, 'AUDIO': 0, 'WONTFIX': 1}) |
188 | 188 |
189 summary = summarized_results(self.port, expected=True, passing=False, fl
aky=False) | 189 summary = summarized_results(self.port, expected=True, passing=False, fl
aky=False) |
190 self.assertEquals(summary['num_failures_by_type'], {'CRASH': 1, 'MISSING
': 0, 'TEXT': 0, 'IMAGE': 0, 'NEEDSREBASELINE': 0, 'NEEDSMANUALREBASELINE': 0, '
PASS': 1, 'REBASELINE': 0, 'SKIP': 0, 'SLOW': 0, 'TIMEOUT': 1, 'IMAGE+TEXT': 0,
'LEAK': 1, 'FAIL': 0, 'AUDIO': 1, 'WONTFIX': 0}) | 190 self.assertEquals(summary['num_failures_by_type'], {'CRASH': 1, 'MISSING
': 0, 'TEXT': 0, 'IMAGE': 0, 'NEEDSREBASELINE': 0, 'NEEDSMANUALREBASELINE': 0, '
PASS': 1, 'REBASELINE': 0, 'SKIP': 0, 'SLOW': 0, 'TIMEOUT': 1, 'IMAGE+TEXT': 0,
'LEAK': 1, 'FAIL': 0, 'AUDIO': 1, 'WONTFIX': 0}) |
191 | 191 |
192 summary = summarized_results(self.port, expected=False, passing=True, fl
aky=False) | 192 summary = summarized_results(self.port, expected=False, passing=True, fl
aky=False) |
193 self.assertEquals(summary['num_failures_by_type'], {'CRASH': 0, 'MISSING
': 0, 'TEXT': 0, 'IMAGE': 0, 'NEEDSREBASELINE': 0, 'NEEDSMANUALREBASELINE': 0, '
PASS': 5, 'REBASELINE': 0, 'SKIP': 1, 'SLOW': 0, 'TIMEOUT': 0, 'IMAGE+TEXT': 0,
'LEAK': 0, 'FAIL': 0, 'AUDIO': 0, 'WONTFIX': 0}) | 193 self.assertEquals(summary['num_failures_by_type'], {'CRASH': 0, 'MISSING
': 0, 'TEXT': 0, 'IMAGE': 0, 'NEEDSREBASELINE': 0, 'NEEDSMANUALREBASELINE': 0, '
PASS': 5, 'REBASELINE': 0, 'SKIP': 1, 'SLOW': 0, 'TIMEOUT': 0, 'IMAGE+TEXT': 0,
'LEAK': 0, 'FAIL': 0, 'AUDIO': 0, 'WONTFIX': 0}) |
194 | 194 |
195 def test_svn_revision(self): | 195 def test_chromium_revision(self): |
196 self.port._options.builder_name = 'dummy builder' | 196 self.port._options.builder_name = 'dummy builder' |
197 summary = summarized_results(self.port, expected=False, passing=False, f
laky=False) | 197 summary = summarized_results(self.port, expected=False, passing=False, f
laky=False) |
198 self.assertNotEquals(summary['blink_revision'], '') | 198 self.assertNotEquals(summary['chromium_revision'], '') |
199 | 199 |
200 def test_bug_entry(self): | 200 def test_bug_entry(self): |
201 self.port._options.builder_name = 'dummy builder' | 201 self.port._options.builder_name = 'dummy builder' |
202 summary = summarized_results(self.port, expected=False, passing=True, fl
aky=False) | 202 summary = summarized_results(self.port, expected=False, passing=True, fl
aky=False) |
203 self.assertEquals(summary['tests']['passes']['skipped']['skip.html']['bu
gs'], ['Bug(test)']) | 203 self.assertEquals(summary['tests']['passes']['skipped']['skip.html']['bu
gs'], ['Bug(test)']) |
204 | 204 |
205 def test_extra_skipped_tests(self): | 205 def test_extra_skipped_tests(self): |
206 self.port._options.builder_name = 'dummy builder' | 206 self.port._options.builder_name = 'dummy builder' |
207 summary = summarized_results(self.port, expected=False, passing=True, fl
aky=False, extra_skipped_tests=['passes/text.html']) | 207 summary = summarized_results(self.port, expected=False, passing=True, fl
aky=False, extra_skipped_tests=['passes/text.html']) |
208 self.assertEquals(summary['tests']['passes']['text.html']['expected'], '
NOTRUN') | 208 self.assertEquals(summary['tests']['passes']['text.html']['expected'], '
NOTRUN') |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 self.assertEquals(summary['tests']['failures']['expected']['leak.html'][
'expected'], 'LEAK') | 350 self.assertEquals(summary['tests']['failures']['expected']['leak.html'][
'expected'], 'LEAK') |
351 self.assertEquals(summary['tests']['failures']['expected']['leak.html'][
'actual'], 'TIMEOUT') | 351 self.assertEquals(summary['tests']['failures']['expected']['leak.html'][
'actual'], 'TIMEOUT') |
352 | 352 |
353 self.assertTrue(summary['tests']['failures']['expected']['audio.html']['
is_unexpected']) | 353 self.assertTrue(summary['tests']['failures']['expected']['audio.html']['
is_unexpected']) |
354 self.assertEquals(summary['tests']['failures']['expected']['audio.html']
['expected'], 'FAIL') | 354 self.assertEquals(summary['tests']['failures']['expected']['audio.html']
['expected'], 'FAIL') |
355 self.assertEquals(summary['tests']['failures']['expected']['audio.html']
['actual'], 'CRASH LEAK LEAK LEAK') | 355 self.assertEquals(summary['tests']['failures']['expected']['audio.html']
['actual'], 'CRASH LEAK LEAK LEAK') |
356 | 356 |
357 self.assertEquals(summary['num_regressions'], 6) | 357 self.assertEquals(summary['num_regressions'], 6) |
358 self.assertEquals(summary['num_passes'], 1) # keyboard.html | 358 self.assertEquals(summary['num_passes'], 1) # keyboard.html |
359 self.assertEquals(summary['num_flaky'], 0) | 359 self.assertEquals(summary['num_flaky'], 0) |
OLD | NEW |