Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(781)

Side by Side Diff: Tools/Scripts/webkitpy/layout_tests/models/test_run_results.py

Issue 23496003: User interruption should still create results.html for run-webkit-tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Corrected INTERRUPTED_EXIT_STATUS import Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright (C) 2010 Google Inc. All rights reserved. 1 # Copyright (C) 2010 Google Inc. All rights reserved.
2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze ged 2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze ged
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 10 matching lines...) Expand all
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 29
30 import logging 30 import logging
31 import signal
31 import time 32 import time
32 33
33 from webkitpy.layout_tests.models import test_expectations 34 from webkitpy.layout_tests.models import test_expectations
34 from webkitpy.layout_tests.models import test_failures 35 from webkitpy.layout_tests.models import test_failures
35 36
36 37
37 _log = logging.getLogger(__name__) 38 _log = logging.getLogger(__name__)
38 39
40 INTERRUPTED_EXIT_STATUS = signal.SIGINT + 128
39 41
40 class TestRunResults(object): 42 class TestRunResults(object):
41 def __init__(self, expectations, num_tests): 43 def __init__(self, expectations, num_tests):
42 self.total = num_tests 44 self.total = num_tests
43 self.remaining = self.total 45 self.remaining = self.total
44 self.expectations = expectations 46 self.expectations = expectations
45 self.expected = 0 47 self.expected = 0
46 self.expected_failures = 0 48 self.expected_failures = 0
47 self.unexpected = 0 49 self.unexpected = 0
48 self.unexpected_failures = 0 50 self.unexpected_failures = 0
49 self.unexpected_crashes = 0 51 self.unexpected_crashes = 0
50 self.unexpected_timeouts = 0 52 self.unexpected_timeouts = 0
51 self.tests_by_expectation = {} 53 self.tests_by_expectation = {}
52 self.tests_by_timeline = {} 54 self.tests_by_timeline = {}
53 self.results_by_name = {} # Map of test name to the last result for the test. 55 self.results_by_name = {} # Map of test name to the last result for the test.
54 self.all_results = [] # All results from a run, including every iterati on of every test. 56 self.all_results = [] # All results from a run, including every iterati on of every test.
55 self.unexpected_results_by_name = {} 57 self.unexpected_results_by_name = {}
56 self.failures_by_name = {} 58 self.failures_by_name = {}
57 self.total_failures = 0 59 self.total_failures = 0
58 self.expected_skips = 0 60 self.expected_skips = 0
59 for expectation in test_expectations.TestExpectations.EXPECTATIONS.value s(): 61 for expectation in test_expectations.TestExpectations.EXPECTATIONS.value s():
60 self.tests_by_expectation[expectation] = set() 62 self.tests_by_expectation[expectation] = set()
61 for timeline in test_expectations.TestExpectations.TIMELINES.values(): 63 for timeline in test_expectations.TestExpectations.TIMELINES.values():
62 self.tests_by_timeline[timeline] = expectations.get_tests_with_timel ine(timeline) 64 self.tests_by_timeline[timeline] = expectations.get_tests_with_timel ine(timeline)
63 self.slow_tests = set() 65 self.slow_tests = set()
64 self.interrupted = False 66 self.interrupted = False
67 self.keyboard_interrupted = False
65 self.run_time = 0 # The wall clock time spent running the tests (layout _test_runner.run()). 68 self.run_time = 0 # The wall clock time spent running the tests (layout _test_runner.run()).
66 69
67 def add(self, test_result, expected, test_is_slow): 70 def add(self, test_result, expected, test_is_slow):
68 result_type_for_stats = test_result.type 71 result_type_for_stats = test_result.type
69 if test_expectations.WONTFIX in self.expectations.model().get_expectatio ns(test_result.test_name): 72 if test_expectations.WONTFIX in self.expectations.model().get_expectatio ns(test_result.test_name):
70 result_type_for_stats = test_expectations.WONTFIX 73 result_type_for_stats = test_expectations.WONTFIX
71 self.tests_by_expectation[result_type_for_stats].add(test_result.test_na me) 74 self.tests_by_expectation[result_type_for_stats].add(test_result.test_na me)
72 75
73 self.results_by_name[test_result.test_name] = test_result 76 self.results_by_name[test_result.test_name] = test_result
74 if test_result.type != test_expectations.SKIP: 77 if test_result.type != test_expectations.SKIP:
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 except Exception, e: 271 except Exception, e:
269 _log.warn("Failed to determine svn revision for checkout (cwd: %s, webki t_base: %s), leaving 'revision' key blank in full_results.json.\n%s" % (port_obj ._filesystem.getcwd(), port_obj.path_from_webkit_base(), e)) 272 _log.warn("Failed to determine svn revision for checkout (cwd: %s, webki t_base: %s), leaving 'revision' key blank in full_results.json.\n%s" % (port_obj ._filesystem.getcwd(), port_obj.path_from_webkit_base(), e))
270 # Handle cases where we're running outside of version control. 273 # Handle cases where we're running outside of version control.
271 import traceback 274 import traceback
272 _log.debug('Failed to learn head svn revision:') 275 _log.debug('Failed to learn head svn revision:')
273 _log.debug(traceback.format_exc()) 276 _log.debug(traceback.format_exc())
274 results['chromium_revision'] = "" 277 results['chromium_revision'] = ""
275 results['blink_revision'] = "" 278 results['blink_revision'] = ""
276 279
277 return results 280 return results
OLDNEW
« no previous file with comments | « Tools/Scripts/webkitpy/layout_tests/controllers/manager.py ('k') | Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698