OLD | NEW |
---|---|
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 20 matching lines...) Expand all Loading... | |
31 The Manager runs a series of tests (TestType interface) against a set | 31 The Manager runs a series of tests (TestType interface) against a set |
32 of test files. If a test file fails a TestType, it returns a list of TestFailur e | 32 of test files. If a test file fails a TestType, it returns a list of TestFailur e |
33 objects to the Manager. The Manager then aggregates the TestFailures to | 33 objects to the Manager. The Manager then aggregates the TestFailures to |
34 create a final report. | 34 create a final report. |
35 """ | 35 """ |
36 | 36 |
37 import datetime | 37 import datetime |
38 import json | 38 import json |
39 import logging | 39 import logging |
40 import random | 40 import random |
41 import signal | |
41 import sys | 42 import sys |
42 import time | 43 import time |
43 | 44 |
44 from webkitpy.common.net.file_uploader import FileUploader | 45 from webkitpy.common.net.file_uploader import FileUploader |
45 from webkitpy.layout_tests.controllers.layout_test_finder import LayoutTestFinde r | 46 from webkitpy.layout_tests.controllers.layout_test_finder import LayoutTestFinde r |
46 from webkitpy.layout_tests.controllers.layout_test_runner import LayoutTestRunne r | 47 from webkitpy.layout_tests.controllers.layout_test_runner import LayoutTestRunne r |
47 from webkitpy.layout_tests.controllers.test_result_writer import TestResultWrite r | 48 from webkitpy.layout_tests.controllers.test_result_writer import TestResultWrite r |
48 from webkitpy.layout_tests.layout_package import json_results_generator | 49 from webkitpy.layout_tests.layout_package import json_results_generator |
49 from webkitpy.layout_tests.models import test_expectations | 50 from webkitpy.layout_tests.models import test_expectations |
50 from webkitpy.layout_tests.models import test_failures | 51 from webkitpy.layout_tests.models import test_failures |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
242 summarized_full_results = test_run_results.summarize_results(self._port, self._expectations, initial_results, retry_results, enabled_pixel_tests_in_retr y) | 243 summarized_full_results = test_run_results.summarize_results(self._port, self._expectations, initial_results, retry_results, enabled_pixel_tests_in_retr y) |
243 summarized_failing_results = test_run_results.summarize_results(self._po rt, self._expectations, initial_results, retry_results, enabled_pixel_tests_in_r etry, only_include_failing=True) | 244 summarized_failing_results = test_run_results.summarize_results(self._po rt, self._expectations, initial_results, retry_results, enabled_pixel_tests_in_r etry, only_include_failing=True) |
244 | 245 |
245 exit_code = summarized_failing_results['num_regressions'] | 246 exit_code = summarized_failing_results['num_regressions'] |
246 if not self._options.dry_run: | 247 if not self._options.dry_run: |
247 self._write_json_files(summarized_full_results, summarized_failing_r esults, initial_results) | 248 self._write_json_files(summarized_full_results, summarized_failing_r esults, initial_results) |
248 self._upload_json_files() | 249 self._upload_json_files() |
249 | 250 |
250 results_path = self._filesystem.join(self._results_directory, "resul ts.html") | 251 results_path = self._filesystem.join(self._results_directory, "resul ts.html") |
251 self._copy_results_html_file(results_path) | 252 self._copy_results_html_file(results_path) |
252 if self._options.show_results and (exit_code or (self._options.full_ results_html and initial_results.total_failures)): | 253 if initial_results.interrupted: |
254 _INTERRUPTED_EXIT_STATUS = signal.SIGINT + 128 | |
255 exit_code = _INTERRUPTED_EXIT_STATUS | |
256 elif self._options.show_results and (exit_code or (self._options.ful l_results_html and initial_results.total_failures)): | |
253 self._port.show_results_html_file(results_path) | 257 self._port.show_results_html_file(results_path) |
254 | 258 |
255 self._printer.print_results(time.time() - start_time, initial_results, s ummarized_failing_results) | 259 self._printer.print_results(time.time() - start_time, initial_results, s ummarized_failing_results) |
Dirk Pranke
2013/08/29 17:04:26
I think we probably shouldn't print the results if
| |
256 return test_run_results.RunDetails(exit_code, summarized_full_results, s ummarized_failing_results, initial_results, retry_results, enabled_pixel_tests_i n_retry) | 260 return test_run_results.RunDetails(exit_code, summarized_full_results, s ummarized_failing_results, initial_results, retry_results, enabled_pixel_tests_i n_retry) |
257 | 261 |
258 def _run_tests(self, tests_to_run, tests_to_skip, repeat_each, iterations, n um_workers, retrying): | 262 def _run_tests(self, tests_to_run, tests_to_skip, repeat_each, iterations, n um_workers, retrying): |
259 | 263 |
260 test_inputs = [] | 264 test_inputs = [] |
261 for _ in xrange(iterations): | 265 for _ in xrange(iterations): |
262 for test in tests_to_run: | 266 for test in tests_to_run: |
263 for _ in xrange(repeat_each): | 267 for _ in xrange(repeat_each): |
264 test_inputs.append(self._test_input_for_file(test)) | 268 test_inputs.append(self._test_input_for_file(test)) |
265 return self._runner.run_tests(self._expectations, test_inputs, tests_to_ skip, num_workers, retrying) | 269 return self._runner.run_tests(self._expectations, test_inputs, tests_to_ skip, num_workers, retrying) |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
415 return int(worker_name.split('/')[1]) if worker_name else -1 | 419 return int(worker_name.split('/')[1]) if worker_name else -1 |
416 | 420 |
417 stats = {} | 421 stats = {} |
418 for result in initial_results.results_by_name.values(): | 422 for result in initial_results.results_by_name.values(): |
419 if result.type != test_expectations.SKIP: | 423 if result.type != test_expectations.SKIP: |
420 stats[result.test_name] = {'results': (_worker_number(result.wor ker_name), result.test_number, result.pid, int(result.test_run_time * 1000), int (result.total_run_time * 1000))} | 424 stats[result.test_name] = {'results': (_worker_number(result.wor ker_name), result.test_number, result.pid, int(result.test_run_time * 1000), int (result.total_run_time * 1000))} |
421 stats_trie = {} | 425 stats_trie = {} |
422 for name, value in stats.iteritems(): | 426 for name, value in stats.iteritems(): |
423 json_results_generator.add_path_to_trie(name, value, stats_trie) | 427 json_results_generator.add_path_to_trie(name, value, stats_trie) |
424 return stats_trie | 428 return stats_trie |
OLD | NEW |