Title: [226031] releases/WebKitGTK/webkit-2.18
Revision
226031
Author
[email protected]
Date
2017-12-18 03:48:00 -0800 (Mon, 18 Dec 2017)

Log Message

Merge r225211 - WebDriver: add timeout option to run-webdriver-tests script
https://bugs.webkit.org/show_bug.cgi?id=179940

Reviewed by Carlos Alberto Lopez Perez.

Tools:

We need to handle timeouts to be able to run the tests in the bots. pytest doesn't support timeouts, but there's
a plugin pytest_timeout that can be used for that.

* Scripts/run-webdriver-tests: Add --timeout command line option.
* Scripts/webkitpy/thirdparty/__init__.py:
(AutoinstallImportHook.find_module): Check if pytest_timeout is imported to install it.
(AutoinstallImportHook._install_pytest_timeout): Install pytest_timeout from pypi.
* Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py:
(WebDriverTestRunnerW3C.__init__): Set PYTEST_TIMEOUT env var with the timeout given.
* Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py:
(WebDriverW3CExecutor.run): Clarify that the timeout received by do_wdspec() is ignored, and pass 0 instead of 25.

WebDriverTests:

Add a base conftest.py to load pytest_timeout plugin.

* imported/w3c/conftest.py: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.18/Tools/ChangeLog (226030 => 226031)


--- releases/WebKitGTK/webkit-2.18/Tools/ChangeLog	2017-12-18 11:47:54 UTC (rev 226030)
+++ releases/WebKitGTK/webkit-2.18/Tools/ChangeLog	2017-12-18 11:48:00 UTC (rev 226031)
@@ -1,3 +1,22 @@
+2017-11-28  Carlos Garcia Campos  <[email protected]>
+
+        WebDriver: add timeout option to run-webdriver-tests script
+        https://bugs.webkit.org/show_bug.cgi?id=179940
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        We need to handle timeouts to be able to run the tests in the bots. pytest doesn't support timeouts, but there's
+        a plugin pytest_timeout that can be used for that.
+
+        * Scripts/run-webdriver-tests: Add --timeout command line option.
+        * Scripts/webkitpy/thirdparty/__init__.py:
+        (AutoinstallImportHook.find_module): Check if pytest_timeout is imported to install it.
+        (AutoinstallImportHook._install_pytest_timeout): Install pytest_timeout from pypi.
+        * Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py:
+        (WebDriverTestRunnerW3C.__init__): Set PYTEST_TIMEOUT env var with the timeout given.
+        * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py:
+        (WebDriverW3CExecutor.run): Clarify that the timeout received by do_wdspec() is ignored, and pass 0 instead of 25.
+
 2017-11-15  Carlos Garcia Campos  <[email protected]>
 
         [WPE] Add initial support for WebDriver

Modified: releases/WebKitGTK/webkit-2.18/Tools/Scripts/run-webdriver-tests (226030 => 226031)


--- releases/WebKitGTK/webkit-2.18/Tools/Scripts/run-webdriver-tests	2017-12-18 11:47:54 UTC (rev 226030)
+++ releases/WebKitGTK/webkit-2.18/Tools/Scripts/run-webdriver-tests	2017-12-18 11:48:00 UTC (rev 226031)
@@ -45,6 +45,8 @@
                          help='Set the configuration to Release')
 option_parser.add_option('--debug', action='', const='Debug', dest="configuration",
                          help='Set the configuration to Debug')
+option_parser.add_option('--timeout', action='', type='int', dest='timeout', default=10,
+                         help='Time in seconds until a test times out (use 0 to disable)')
 option_parser.add_option('--display-server', choices=['xvfb', 'xorg', 'weston', 'wayland'], default='xvfb',
                          help='"xvfb": Use a virtualized X11 server. "xorg": Use the current X11 session. '
                               '"weston": Use a virtualized Weston server. "wayland": Use the current wayland session.')

Modified: releases/WebKitGTK/webkit-2.18/Tools/Scripts/webkitpy/thirdparty/__init__.py (226030 => 226031)


--- releases/WebKitGTK/webkit-2.18/Tools/Scripts/webkitpy/thirdparty/__init__.py	2017-12-18 11:47:54 UTC (rev 226030)
+++ releases/WebKitGTK/webkit-2.18/Tools/Scripts/webkitpy/thirdparty/__init__.py	2017-12-18 11:48:00 UTC (rev 226031)
@@ -110,6 +110,8 @@
             self._install_mozlog()
         elif '.mozprocess' in fullname:
             self._install_mozprocess()
+        elif '.pytest_timeout' in fullname:
+            self._install_pytest_timeout()
 
     def _install_mechanize(self):
         self._install("https://pypi.python.org/packages/source/m/mechanize/mechanize-0.2.5.tar.gz",
@@ -133,6 +135,10 @@
         self._install("https://pypi.python.org/packages/cb/26/144dbc28d1f40e392f8a0cbee771ba624a61017f016c77ad88424d84b230/mozprocess-0.25.tar.gz#md5=07a04e6ae1a705705e4b44969fe7a182",
                               "mozprocess-0.25/mozprocess")
 
+    def _install_pytest_timeout(self):
+        self._install("https://pypi.python.org/packages/cc/b7/b2a61365ea6b6d2e8881360ae7ed8dad0327ad2df89f2f0be4a02304deb2/pytest-timeout-1.2.0.tar.gz#md5=83607d91aa163562c7ee835da57d061d",
+                              "pytest-timeout-1.2.0/pytest_timeout.py")
+
     def _install_pylint(self):
         self._ensure_autoinstalled_dir_is_in_sys_path()
         if (not self._fs.exists(self._fs.join(_AUTOINSTALLED_DIR, "pylint")) or

Modified: releases/WebKitGTK/webkit-2.18/Tools/Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py (226030 => 226031)


--- releases/WebKitGTK/webkit-2.18/Tools/Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py	2017-12-18 11:47:54 UTC (rev 226030)
+++ releases/WebKitGTK/webkit-2.18/Tools/Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py	2017-12-18 11:48:00 UTC (rev 226031)
@@ -44,6 +44,10 @@
         _log.info('Using driver at %s' % (self._driver.binary_path()))
         _log.info('Browser: %s' % (self._driver.browser_name()))
 
+        timeout = self._port.get_option('timeout')
+        if timeout > 0:
+            os.environ['PYTEST_TIMEOUT'] = str(timeout)
+
         self._results = []
         self._server = WebDriverW3CWebServer(self._port)
 

Modified: releases/WebKitGTK/webkit-2.18/Tools/Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py (226030 => 226031)


--- releases/WebKitGTK/webkit-2.18/Tools/Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py	2017-12-18 11:47:54 UTC (rev 226030)
+++ releases/WebKitGTK/webkit-2.18/Tools/Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py	2017-12-18 11:48:00 UTC (rev 226031)
@@ -41,6 +41,7 @@
 _ensure_directory_in_path(os.path.join(w3c_tools_dir, 'wptrunner'))
 _ensure_directory_in_path(os.path.join(w3c_tools_dir, "webdriver"))
 
+import webkitpy.thirdparty.autoinstalled.pytest_timeout
 from wptrunner.executors.base import WdspecExecutor, WebDriverProtocol
 from wptrunner.webdriver_server import WebDriverServer
 
@@ -136,4 +137,5 @@
         self.protocol.teardown()
 
     def run(self, path):
-        return self.do_wdspec(self.protocol.session_config, path, 25)
+        # Timeout here doesn't really matter because it's ignored, so we pass 0.
+        return self.do_wdspec(self.protocol.session_config, path, 0)

Modified: releases/WebKitGTK/webkit-2.18/WebDriverTests/ChangeLog (226030 => 226031)


--- releases/WebKitGTK/webkit-2.18/WebDriverTests/ChangeLog	2017-12-18 11:47:54 UTC (rev 226030)
+++ releases/WebKitGTK/webkit-2.18/WebDriverTests/ChangeLog	2017-12-18 11:48:00 UTC (rev 226031)
@@ -1,3 +1,14 @@
+2017-11-28  Carlos Garcia Campos  <[email protected]>
+
+        WebDriver: add timeout option to run-webdriver-tests script
+        https://bugs.webkit.org/show_bug.cgi?id=179940
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        Add a base conftest.py to load pytest_timeout plugin.
+
+        * imported/w3c/conftest.py: Added.
+
 2017-11-21  Carlos Garcia Campos  <[email protected]>
 
         Unreviewed. Update W3C WebDriver imported tests.

Added: releases/WebKitGTK/webkit-2.18/WebDriverTests/imported/w3c/conftest.py (0 => 226031)


--- releases/WebKitGTK/webkit-2.18/WebDriverTests/imported/w3c/conftest.py	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.18/WebDriverTests/imported/w3c/conftest.py	2017-12-18 11:48:00 UTC (rev 226031)
@@ -0,0 +1 @@
+pytest_plugins = 'pytest_timeout',
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to