Changeset 276512 in webkit
- Timestamp:
- Apr 23, 2021, 12:34:35 PM (5 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 added
- 4 edited
-
ChangeLog (modified) (1 diff)
-
Scripts/webkitpy/common/system/executive_unittest.py (modified) (1 diff)
-
Scripts/webkitpy/conftest.py (added)
-
Scripts/webkitpy/pytest.ini (added)
-
Scripts/webkitpy/test/main_unittest.py (modified) (1 diff)
-
Scripts/webkitpy/test/markers.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r276505 r276512 1 2021-04-23 Sam Sneddon <gsnedders@apple.com> 2 3 Add a conftest.py to run existing webkitpy tests in pytest 4 https://bugs.webkit.org/show_bug.cgi?id=224687 5 6 Reviewed by Jonathan Bedard. 7 8 * Scripts/webkitpy/common/system/executive_unittest.py: 9 (ExecutiveTest.serial_test_run_in_parallel): Deal with the fact that pytest 10 running the tests might be not be the same version as the autoinstalled version, 11 and not API compatible. 12 * Scripts/webkitpy/conftest.py: Added. 13 (pytest_configure): Define the markers the plugins in conftest use 14 (pytest_addoption): Add --run-integration to allow them to be disabled by default. 15 (pytest_pycollect_makeitem): Rename serial/integration tests so pytest finds them. 16 (pytest_collection_modifyitems): Mark tests as skipped when needed per the above. 17 * Scripts/webkitpy/pytest.ini: Added. 18 * Scripts/webkitpy/test/main_unittest.py: 19 (TestStubs): Stop these from being picked up by pytest as tests. 20 * Scripts/webkitpy/test/markers.py: Fix this so pytest is technically optional, 21 even though it is always present because of the autoinstalled copy. 22 1 23 2021-04-23 Aakash Jain <aakash_jain@apple.com> 2 24 -
trunk/Tools/Scripts/webkitpy/common/system/executive_unittest.py
r276434 r276512 251 251 cwd = os.getcwd() 252 252 commands = [tuple([cmd_line, cwd])] * NUM_PROCESSES 253 start = time.time() 254 command_outputs = Executive().run_in_parallel(commands, processes=NUM_PROCESSES) 255 done = time.time() 253 254 try: 255 # we overwrite __main__ to be this to avoid any issues with 256 # multiprocessing's spawning caused by multiple versions of pytest on 257 # sys.path 258 old_main = sys.modules["__main__"] 259 sys.modules["__main__"] = sys.modules[__name__] 260 start = time.time() 261 command_outputs = Executive().run_in_parallel(commands, processes=NUM_PROCESSES) 262 done = time.time() 263 finally: 264 sys.modules["__main__"] = old_main 265 256 266 self.assertTrue(done - start < NUM_PROCESSES * DELAY_SECS) 257 267 self.assertEqual([output[1] for output in command_outputs], [b'hello\n'] * NUM_PROCESSES) -
trunk/Tools/Scripts/webkitpy/test/main_unittest.py
r276434 r276512 39 39 40 40 class TestStubs(unittest.TestCase): 41 __pytest_no_rewrite__ = True 42 41 43 def test_empty(self): 42 44 pass -
trunk/Tools/Scripts/webkitpy/test/markers.py
r276436 r276512 22 22 23 23 import unittest 24 25 try: 26 import pytest 27 except ImportError: 28 pass 24 29 25 30
Note:
See TracChangeset
for help on using the changeset viewer.