Title: [272568] trunk/Tools
Revision
272568
Author
[email protected]
Date
2021-02-08 22:51:12 -0800 (Mon, 08 Feb 2021)

Log Message

Move layout_test_runner.Worker._update_test_input to LayoutTestRunner
https://bugs.webkit.org/show_bug.cgi?id=221577

Patch by Sam Sneddon <[email protected]> on 2021-02-08
Reviewed by Jonathan Bedard.

* Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:
(LayoutTestRunner.run_tests):
(LayoutTestRunner._update_test_input):
(Worker.handle):
(Worker._run_test):
(Worker._update_test_input): Deleted.
* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager._run_tests):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (272567 => 272568)


--- trunk/Tools/ChangeLog	2021-02-09 05:37:44 UTC (rev 272567)
+++ trunk/Tools/ChangeLog	2021-02-09 06:51:12 UTC (rev 272568)
@@ -1,3 +1,19 @@
+2021-02-08  Sam Sneddon  <[email protected]>
+
+        Move layout_test_runner.Worker._update_test_input to LayoutTestRunner
+        https://bugs.webkit.org/show_bug.cgi?id=221577
+
+        Reviewed by Jonathan Bedard.
+
+        * Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:
+        (LayoutTestRunner.run_tests):
+        (LayoutTestRunner._update_test_input):
+        (Worker.handle):
+        (Worker._run_test):
+        (Worker._update_test_input): Deleted.
+        * Scripts/webkitpy/layout_tests/controllers/manager.py:
+        (Manager._run_tests):
+
 2021-02-08  Stephanie Lewis  <[email protected]>
 
         <rdar://problem/70402593> Motionmark failed to start webserver

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py (272567 => 272568)


--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py	2021-02-09 05:37:44 UTC (rev 272567)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py	2021-02-09 06:51:12 UTC (rev 272568)
@@ -92,9 +92,12 @@
         all_shards = self._sharder.shard_tests(test_inputs, child_process_count, self._options.fully_parallel)
         return min(child_process_count, len(all_shards))
 
-    def run_tests(self, expectations, test_inputs, tests_to_skip, num_workers, retrying):
+    def run_tests(self, expectations, test_inputs, tests_to_skip, num_workers, retrying, device_type=None):
         self._expectations = expectations
-        self._test_inputs = test_inputs
+        self._test_inputs = []
+        for test_input in test_inputs:
+            self._update_test_input(test_input, device_type)
+            self._test_inputs.append(test_input)
 
         self._retrying = retrying
 
@@ -138,6 +141,15 @@
 
         return run_results
 
+    def _update_test_input(self, test_input, device_type=None):
+        if test_input.reference_files is None:
+            # Lazy initialization.
+            test_input.reference_files = self._port.reference_files(test_input.test_name, device_type=device_type)
+        if test_input.reference_files:
+            test_input.should_run_pixel_test = True
+        else:
+            test_input.should_run_pixel_test = self._port.should_run_as_pixel_test(test_input)
+
     def _worker_factory(self, worker_connection):
         results_directory = self._results_directory
         if self._retrying:
@@ -292,15 +304,6 @@
 
         self._finished_test_group(test_inputs)
 
-    def _update_test_input(self, test_input):
-        if test_input.reference_files is None:
-            # Lazy initialization.
-            test_input.reference_files = self._port.reference_files(test_input.test_name, device_type=self._port.target_host(self._worker_number).device_type)
-        if test_input.reference_files:
-            test_input.should_run_pixel_test = True
-        else:
-            test_input.should_run_pixel_test = self._port.should_run_as_pixel_test(test_input)
-
     def _run_test(self, test_input, shard_name):
         self._batch_count += 1
 
@@ -309,7 +312,6 @@
             self._batch_count = 0
             stop_when_done = True
 
-        self._update_test_input(test_input)
         test_timeout_sec = self._timeout(test_input)
         start = time.time()
         self._caller.post('started_test', test_input, test_timeout_sec)

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


--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py	2021-02-09 05:37:44 UTC (rev 272567)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py	2021-02-09 06:51:12 UTC (rev 272568)
@@ -403,7 +403,7 @@
     def _run_tests(self, tests_to_run, tests_to_skip, repeat_each, iterations, num_workers, retrying, device_type=None):
         test_inputs = self._get_test_inputs(tests_to_run, repeat_each, iterations, device_type=device_type)
 
-        return self._runner.run_tests(self._expectations[device_type], test_inputs, tests_to_skip, num_workers, retrying)
+        return self._runner.run_tests(self._expectations[device_type], test_inputs, tests_to_skip, num_workers, retrying, device_type)
 
     def _clean_up_run(self):
         _log.debug("Flushing stdout")
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to