Title: [136730] trunk/Tools
Revision
136730
Author
[email protected]
Date
2012-12-05 12:18:02 -0800 (Wed, 05 Dec 2012)

Log Message

nrwt: move creation of the resultsummary objects into Manager._run_tests()
https://bugs.webkit.org/show_bug.cgi?id=104048

Reviewed by Ojan Vafai.

This is a preparatory step to making the resultsummary just get
returned from the layout_test_runner; this does most of manager-side
changes.

* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager._prepare_lists):
(Manager.run):
(Manager._run_tests):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (136729 => 136730)


--- trunk/Tools/ChangeLog	2012-12-05 20:17:30 UTC (rev 136729)
+++ trunk/Tools/ChangeLog	2012-12-05 20:18:02 UTC (rev 136730)
@@ -1,3 +1,19 @@
+2012-12-05  Dirk Pranke  <[email protected]>
+
+        nrwt: move creation of the resultsummary objects into Manager._run_tests()
+        https://bugs.webkit.org/show_bug.cgi?id=104048
+
+        Reviewed by Ojan Vafai.
+
+        This is a preparatory step to making the resultsummary just get
+        returned from the layout_test_runner; this does most of manager-side
+        changes.
+
+        * Scripts/webkitpy/layout_tests/controllers/manager.py:
+        (Manager._prepare_lists):
+        (Manager.run):
+        (Manager._run_tests):
+
 2012-12-05  Leo Yang  <[email protected]>
 
         [BlackBerry] Enable CSS_IMAGE_RESOLUTION

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py (136729 => 136730)


--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py	2012-12-05 20:17:30 UTC (rev 136729)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py	2012-12-05 20:18:02 UTC (rev 136730)
@@ -315,14 +315,8 @@
         self._expectations.add_skipped_tests(tests_in_other_chunks)
         tests_to_skip.update(tests_in_other_chunks)
 
-        summary = ResultSummary(self._expectations, len(tests_to_run) * self._options.repeat_each * self._options.iterations + len(tests_to_skip))
+        return tests_to_run, tests_to_skip
 
-        for test_name in set(tests_to_skip):
-            result = test_results.TestResult(test_name)
-            result.type = test_expectations.SKIP
-            summary.add(result, expected=True, test_is_slow=self._test_is_slow(test_name))
-        return summary, tests_to_run
-
     def _test_input_for_file(self, test_file):
         return TestInput(test_file,
             self._options.slow_time_out_ms if self._test_is_slow(test_file) else self._options.time_out_ms,
@@ -382,23 +376,23 @@
         self._expectations = test_expectations.TestExpectations(self._port, test_names)
 
         num_all_test_files_found = len(test_names)
-        result_summary, test_names = self._prepare_lists(paths, test_names)
+        tests_to_run, tests_to_skip = self._prepare_lists(paths, test_names)
 
+        self._printer.print_found(num_all_test_files_found, len(tests_to_run), self._options.repeat_each, self._options.iterations)
+
         # Check to make sure we're not skipping every test.
-        if not test_names:
+        if not tests_to_run:
             _log.critical('No tests to run.')
             return -1
 
-        self._printer.print_found(num_all_test_files_found, len(test_names), self._options.repeat_each, self._options.iterations)
-        self._printer.print_expected(result_summary, self._expectations.get_tests_with_result_type)
-
-        if not self._set_up_run(test_names):
+        if not self._set_up_run(tests_to_run):
             return -1
 
         start_time = time.time()
 
         try:
-            result_summary = self._run_tests(test_names, result_summary, int(self._options.child_processes), retrying=False)
+            result_summary = self._run_tests(tests_to_run, tests_to_skip, self._options.repeat_each, self._options.iterations,
+                                             int(self._options.child_processes), retrying=False)
 
             # We exclude the crashes from the list of results to retry, because
             # we want to treat even a potentially flaky crash as an error.
@@ -408,7 +402,7 @@
                 _log.info('')
                 _log.info("Retrying %d unexpected failure(s) ..." % len(failures))
                 _log.info('')
-                retry_summary = self._run_tests(failures, ResultSummary(self._expectations, len(failures)), 1, retrying=True)
+                retry_summary = self._run_tests(failures, tests_to_skip=set(), repeat_each=1, iterations=1, num_workers=1, retrying=True)
             else:
                 retry_summary = None
         finally:
@@ -443,16 +437,27 @@
 
         return self._port.exit_code_from_summarized_results(unexpected_results)
 
-    def _run_tests(self, tests, result_summary, num_workers, retrying):
-        needs_http = self._port.requires_http_server() or any(self._is_http_test(test) for test in tests)
-        needs_websockets = any(self._is_websocket_test(test) for test in tests)
+    def _run_tests(self, tests_to_run, tests_to_skip, repeat_each, iterations, num_workers, retrying):
+        needs_http = self._port.requires_http_server() or any(self._is_http_test(test) for test in tests_to_run)
+        needs_websockets = any(self._is_websocket_test(test) for test in tests_to_run)
+
+        summary = ResultSummary(self._expectations, len(set(tests_to_run)) * repeat_each * iterations)
+        for test_name in set(tests_to_skip):
+            result = test_results.TestResult(test_name)
+            result.type = test_expectations.SKIP
+            summary.add(result, expected=True, test_is_slow=self._test_is_slow(test_name))
+
         test_inputs = []
-        for _ in xrange(self._options.iterations):
-            for test in tests:
-                for _ in xrange(self._options.repeat_each):
+        for _ in xrange(iterations):
+            for test in tests_to_run:
+                for _ in xrange(repeat_each):
                     test_inputs.append(self._test_input_for_file(test))
-        return self._runner.run_tests(test_inputs, self._expectations, result_summary, num_workers, needs_http, needs_websockets, retrying)
 
+        if not retrying:
+            self._printer.print_expected(summary, self._expectations.get_tests_with_result_type)
+
+        return self._runner.run_tests(test_inputs, self._expectations, summary, num_workers, needs_http, needs_websockets, retrying)
+
     def _clean_up_run(self):
         """Restores the system after we're done running tests."""
         _log.debug("flushing stdout")
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to