Title: [277675] trunk/Tools
Revision
277675
Author
jbed...@apple.com
Date
2021-05-18 13:58:33 -0700 (Tue, 18 May 2021)

Log Message

[webkitpy] Forward booted simulators to children processes
https://bugs.webkit.org/show_bug.cgi?id=225933
<rdar://problem/78169900>

Rubber-stamped by Aakash Jain.

* Scripts/webkitpy/api_tests/runner.py:
(setup_shard): Set DeviceManager global variable from parent process.
(Runner.command_for_port): Use Port's device manager instead of simulated device manager.
(Runner.run): Pass DeviceManager details to children processes.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (277674 => 277675)


--- trunk/Tools/ChangeLog	2021-05-18 20:49:25 UTC (rev 277674)
+++ trunk/Tools/ChangeLog	2021-05-18 20:58:33 UTC (rev 277675)
@@ -1,3 +1,16 @@
+2021-05-18  Jonathan Bedard  <jbed...@apple.com>
+
+        [webkitpy] Forward booted simulators to children processes
+        https://bugs.webkit.org/show_bug.cgi?id=225933
+        <rdar://problem/78169900>
+
+        Rubber-stamped by Aakash Jain.
+
+        * Scripts/webkitpy/api_tests/runner.py:
+        (setup_shard): Set DeviceManager global variable from parent process.
+        (Runner.command_for_port): Use Port's device manager instead of simulated device manager.
+        (Runner.run): Pass DeviceManager details to children processes.
+
 2021-05-18  Aakash Jain  <aakash_j...@apple.com>
 
         [ews] Style fixes in steps_unittest.py

Modified: trunk/Tools/Scripts/webkitpy/api_tests/runner.py (277674 => 277675)


--- trunk/Tools/Scripts/webkitpy/api_tests/runner.py	2021-05-18 20:49:25 UTC (rev 277674)
+++ trunk/Tools/Scripts/webkitpy/api_tests/runner.py	2021-05-18 20:58:33 UTC (rev 277675)
@@ -29,12 +29,15 @@
 
 from webkitpy.common.iteration_compatibility import iteritems
 from webkitpy.port.server_process import ServerProcess, _log as server_process_logger
-from webkitpy.xcode.simulated_device import SimulatedDeviceManager
 
 _log = logging.getLogger(__name__)
 
 
-def setup_shard(port=None):
+def setup_shard(port=None, devices=None):
+    devices = devices or dict()
+    port.DEVICE_MANAGER.AVAILABLE_DEVICES = devices.get('available_devices', [])
+    port.DEVICE_MANAGER.INITIALIZED_DEVICES = devices.get('initialized_devices', None)
+
     return _Worker.setup(port=port)
 
 
@@ -86,8 +89,8 @@
         if (port.get_option('force')):
             args.append('--gtest_also_run_disabled_tests=1')
         if 'simulator' in port.port_name:
-            assert SimulatedDeviceManager.INITIALIZED_DEVICES
-            return ['/usr/bin/xcrun', 'simctl', 'spawn', SimulatedDeviceManager.INITIALIZED_DEVICES[0].udid] + args
+            assert port.DEVICE_MANAGER.INITIALIZED_DEVICES
+            return ['/usr/bin/xcrun', 'simctl', 'spawn', port.DEVICE_MANAGER.INITIALIZED_DEVICES[0].udid] + args
         elif 'device' in port.port_name:
             raise RuntimeError('Running api tests on {} is not supported'.format(port.port_name))
         elif port.host.platform.is_win():
@@ -122,8 +125,10 @@
 
             with TaskPool(
                 workers=self._num_workers,
-                setup=setup_shard, setupkwargs=dict(port=self.port),
-                teardown=teardown_shard,
+                setup=setup_shard, setupkwargs=dict(port=self.port, devices=dict(
+                    available_devices=self.port.DEVICE_MANAGER.AVAILABLE_DEVICES,
+                    initialized_devices=self.port.DEVICE_MANAGER.INITIALIZED_DEVICES,
+                )), teardown=teardown_shard,
             ) as pool:
                 for name, tests in iteritems(shards):
                     pool.do(run_shard, name, *tests)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to