haikuwebkit/Tools/Scripts/run-webdriver-tests

94 lines
4.5 KiB
Plaintext
Raw Permalink Normal View History

WebDriver: Add support to import and run W3C tests https://bugs.webkit.org/show_bug.cgi?id=177304 Reviewed by Brian Burg. Tools: WPT has now several WebDriver tests, and new ones are going to be added to cover the whole spec. This patch adds the initial support for running W3C tests. The script import-w3c-webdriver-tests reuses parts of the W3C test downloader to download the tests and required tools from WPT repository into WebDriverTests directory. Tests can be run with run-webdriver-tests, a new script that works similar to other test runner scripts. For now it shows a summary at the end of the execution, there aren't expectations yet, since we are not ready to run those tests in the bots. Once we are ready to properly run the tests, we can add the expectations support and run the tests in the bots. * Scripts/import-w3c-webdriver-tests: Added. * Scripts/run-webdriver-tests: Added. * Scripts/webkitpy/style/checker.py: Skip WebDriverTests directory since it only contains third-party python code. * Scripts/webkitpy/thirdparty/__init__.py: Add support to autodownload mozlog and mozprocess since they are required by the WebDriver tests. * Scripts/webkitpy/webdriver_tests/__init__.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_driver.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_driver_gtk.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_result.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_w3c_web_server.py: Added. WebDriverTests: Add json file used by the importer and the result of running the importer. * imported/w3c/importer.json: Added. * imported/w3c/tools/pytest/: Added. * imported/w3c/tools/webdriver/: Added. * imported/w3c/tools/wptrunner/: Added. * imported/w3c/webdriver/: Added. Canonical link: https://commits.webkit.org/195008@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-26 10:58:17 +00:00
#!/usr/bin/env python
# Copyright (C) 2017 Igalia S.L.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import logging
import optparse
import sys
from webkitpy.common.host import Host
from webkitpy.webdriver_tests.webdriver_test_runner import WebDriverTestRunner
from webkitpy.common.system.logutils import configure_logging
_log = logging.getLogger(__name__)
option_parser = optparse.OptionParser(usage='usage: %prog [options] [test...]')
option_parser.add_option('--verbose', action='store_true', dest='verbose',
help='Show debug message')
option_parser.add_option('--platform', action='store',
help='Platform to use (e.g., "gtk")')
option_parser.add_option('--gtk', action='store_const', dest='platform', const='gtk',
help='Alias for --platform=gtk')
[WPE] Add initial support for WebDriver https://bugs.webkit.org/show_bug.cgi?id=179727 Reviewed by Michael Catanzaro. .: Enable WebDriver by default in WPE. * Source/cmake/OptionsWPE.cmake: Source/WebDriver: Add WPE implementation for platform-specific methods. Move the version handling to a common file WebDriverServiceGLib.cpp. * Capabilities.h: * PlatformGTK.cmake: * PlatformWPE.cmake: * glib/WebDriverServiceGLib.cpp: Added. (WebDriver::parseVersion): (WebDriver::WebDriverService::platformCompareBrowserVersions): * gtk/WebDriverServiceGtk.cpp: * wpe/WebDriverServiceWPE.cpp: Copied from Source/WebDriver/gtk/WebDriverServiceGtk.cpp. (WebDriver::WebDriverService::platformCapabilities): (WebDriver::WebDriverService::platformValidateCapability const): (WebDriver::WebDriverService::platformMatchCapability const): (WebDriver::WebDriverService::platformParseCapabilities const): Tools: Make it possible to run WebDriver tests with WPE. * Scripts/run-webdriver-tests: Add --wpe alias for --platform=wpe. * Scripts/webkitpy/port/wpe.py: (WPEPort.__init__): Initialize _display_server from options. (WPEPort._driver_class): Use WaylandDriver when wayland is passed as display server option. * Scripts/webkitpy/webdriver_tests/webdriver_driver.py: (WebDriver.browser_env): Add virtual method to get the environment that should be used. * Scripts/webkitpy/webdriver_tests/webdriver_driver_wpe.py: Copied from Tools/Scripts/webkitpy/webdriver_tests/webdriver_driver.py. (WebDriverWPE): (WebDriverWPE.__init__): (WebDriverWPE.binary_path): (WebDriverWPE.browser_name): (WebDriverWPE.capabilities): (WebDriverWPE.browser_env): * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: (WebDriverW3CExecutor.__init__): Update the environment with the one provided by the driver. * wpe/jhbuild.modules: Upgrade dyz to newer version that supports automation. Canonical link: https://commits.webkit.org/195790@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-16 12:48:22 +00:00
option_parser.add_option('--wpe', action='store_const', dest='platform', const='wpe',
help='Alias for --platform=wpe')
WebDriver: Add support to import and run W3C tests https://bugs.webkit.org/show_bug.cgi?id=177304 Reviewed by Brian Burg. Tools: WPT has now several WebDriver tests, and new ones are going to be added to cover the whole spec. This patch adds the initial support for running W3C tests. The script import-w3c-webdriver-tests reuses parts of the W3C test downloader to download the tests and required tools from WPT repository into WebDriverTests directory. Tests can be run with run-webdriver-tests, a new script that works similar to other test runner scripts. For now it shows a summary at the end of the execution, there aren't expectations yet, since we are not ready to run those tests in the bots. Once we are ready to properly run the tests, we can add the expectations support and run the tests in the bots. * Scripts/import-w3c-webdriver-tests: Added. * Scripts/run-webdriver-tests: Added. * Scripts/webkitpy/style/checker.py: Skip WebDriverTests directory since it only contains third-party python code. * Scripts/webkitpy/thirdparty/__init__.py: Add support to autodownload mozlog and mozprocess since they are required by the WebDriver tests. * Scripts/webkitpy/webdriver_tests/__init__.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_driver.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_driver_gtk.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_result.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_w3c_web_server.py: Added. WebDriverTests: Add json file used by the importer and the result of running the importer. * imported/w3c/importer.json: Added. * imported/w3c/tools/pytest/: Added. * imported/w3c/tools/webdriver/: Added. * imported/w3c/tools/wptrunner/: Added. * imported/w3c/webdriver/: Added. Canonical link: https://commits.webkit.org/195008@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-26 10:58:17 +00:00
option_parser.add_option('--release', action='store_const', const='Release', dest="configuration",
help='Set the configuration to Release')
option_parser.add_option('--debug', action='store_const', const='Debug', dest="configuration",
help='Set the configuration to Debug')
option_parser.add_option('--timeout', action='store', type='int', dest='timeout', default=10,
help='Time in seconds until a test times out (use 0 to disable)')
option_parser.add_option('--json-output', action='store', metavar="FILE",
help='Write results to JSON file at the given path')
[WPE] Add a MiniBrowser and use it to run WebDriver tests https://bugs.webkit.org/show_bug.cgi?id=186345 Reviewed by Žan Doberšek. .: Add an option to enable building the MiniBrowser. * Source/cmake/FindWaylandProtocols.cmake: Added. * Source/cmake/OptionsWPE.cmake: Source/WebDriver: Use MiniBrowser instead of dyz as the default WebDriver browser for WPE. * wpe/WebDriverServiceWPE.cpp: (WebDriver::WebDriverService::platformParseCapabilities const): Tools: Most of the code is based on dyz and gtk MiniBrowser. This patch adds a new internal library WPEToolingBackends, including the headless view backend and a new window backend to be used by the MiniBrowser. MiniBrowser can also run in headless mode, by using the headless backend instead of the window one, which will allow us to run the WebDriver tests in the bots. * CMakeLists.txt: * MiniBrowser/wpe/CMakeLists.txt: Added. * MiniBrowser/wpe/main.cpp: Added. (automationStartedCallback): (createViewBackend): (main): * Scripts/run-minibrowser: Remove WPE specific code. * Scripts/run-webdriver-tests: Add headless display-server option. * Scripts/webkitdirs.pm: (launcherName): Remove WPE specific code. * Scripts/webkitpy/webdriver_tests/webdriver_driver_wpe.py: (WebDriverWPE.browser_name): Return MiniBrowser. (WebDriverWPE.browser_path): Return the path to the MiniBrowser in build dir. (WebDriverWPE.browser_args): Add --headless when running in headless mode. (WebDriverWPE.capabilities): Use the full browser path. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner_selenium.py: (WebDriverTestRunnerSelenium.collect_tests): Fix early return value. * TestWebKitAPI/PlatformWPE.cmake: Use WPEToolingBackends instead of HeadlessViewBackend. * TestWebKitAPI/PlatformWebView.h: Ditto. * TestWebKitAPI/glib/PlatformWPE.cmake: Ditto * TestWebKitAPI/glib/WebKitGLib/TestMain.h: (Test::createWebViewBackend): Ditto. * TestWebKitAPI/wpe/PlatformWebViewWPE.cpp: (TestWebKitAPI::PlatformWebView::initialize): Ditto. * WebKitTestRunner/PlatformWPE.cmake: Ditto. * WebKitTestRunner/PlatformWebView.h: Ditto. * WebKitTestRunner/wpe/PlatformWebViewWPE.cpp: (WTR::PlatformWebView::PlatformWebView): Ditto. * wpe/HeadlessViewBackend/CMakeLists.txt: Removed. * wpe/backends/CMakeLists.txt: Added. * wpe/backends/HeadlessViewBackend.cpp: Renamed from Tools/wpe/HeadlessViewBackend/HeadlessViewBackend.cpp. (WPEToolingBackends::getEGLDisplay): (WPEToolingBackends::HeadlessViewBackend::HeadlessViewBackend): (WPEToolingBackends::HeadlessViewBackend::~HeadlessViewBackend): (WPEToolingBackends::HeadlessViewBackend::createSnapshot): (WPEToolingBackends::HeadlessViewBackend::performUpdate): (WPEToolingBackends::HeadlessViewBackend::displayBuffer): * wpe/backends/HeadlessViewBackend.h: Renamed from Tools/wpe/HeadlessViewBackend/HeadlessViewBackend.h. * wpe/backends/ViewBackend.cpp: Added. (WPEToolingBackends::ViewBackend::ViewBackend): (WPEToolingBackends::ViewBackend::~ViewBackend): (WPEToolingBackends::ViewBackend::initialize): (WPEToolingBackends::ViewBackend::setInputClient): (WPEToolingBackends::ViewBackend::backend const): (WPEToolingBackends::ViewBackend::dispatchInputPointerEvent): (WPEToolingBackends::ViewBackend::dispatchInputAxisEvent): (WPEToolingBackends::ViewBackend::dispatchInputKeyboardEvent): * wpe/backends/ViewBackend.h: Added. * wpe/backends/WindowViewBackend.cpp: Added. (WPEToolingBackends::WindowViewBackend::WindowViewBackend): (WPEToolingBackends::WindowViewBackend::~WindowViewBackend): (WPEToolingBackends::WindowViewBackend::displayBuffer): (WPEToolingBackends::WindowViewBackend::handleKeyEvent): * wpe/backends/WindowViewBackend.h: Added. * wpe/jhbuild.modules: Remove dyz and add wayland-protocols. Canonical link: https://commits.webkit.org/201827@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232670 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-06-11 06:43:14 +00:00
option_parser.add_option('--display-server', choices=['xvfb', 'xorg', 'weston', 'wayland', 'headless'], default='xvfb',
WebDriver: Add support to import and run W3C tests https://bugs.webkit.org/show_bug.cgi?id=177304 Reviewed by Brian Burg. Tools: WPT has now several WebDriver tests, and new ones are going to be added to cover the whole spec. This patch adds the initial support for running W3C tests. The script import-w3c-webdriver-tests reuses parts of the W3C test downloader to download the tests and required tools from WPT repository into WebDriverTests directory. Tests can be run with run-webdriver-tests, a new script that works similar to other test runner scripts. For now it shows a summary at the end of the execution, there aren't expectations yet, since we are not ready to run those tests in the bots. Once we are ready to properly run the tests, we can add the expectations support and run the tests in the bots. * Scripts/import-w3c-webdriver-tests: Added. * Scripts/run-webdriver-tests: Added. * Scripts/webkitpy/style/checker.py: Skip WebDriverTests directory since it only contains third-party python code. * Scripts/webkitpy/thirdparty/__init__.py: Add support to autodownload mozlog and mozprocess since they are required by the WebDriver tests. * Scripts/webkitpy/webdriver_tests/__init__.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_driver.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_driver_gtk.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_result.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_w3c_web_server.py: Added. WebDriverTests: Add json file used by the importer and the result of running the importer. * imported/w3c/importer.json: Added. * imported/w3c/tools/pytest/: Added. * imported/w3c/tools/webdriver/: Added. * imported/w3c/tools/wptrunner/: Added. * imported/w3c/webdriver/: Added. Canonical link: https://commits.webkit.org/195008@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-26 10:58:17 +00:00
help='"xvfb": Use a virtualized X11 server. "xorg": Use the current X11 session. '
[WPE] Add a MiniBrowser and use it to run WebDriver tests https://bugs.webkit.org/show_bug.cgi?id=186345 Reviewed by Žan Doberšek. .: Add an option to enable building the MiniBrowser. * Source/cmake/FindWaylandProtocols.cmake: Added. * Source/cmake/OptionsWPE.cmake: Source/WebDriver: Use MiniBrowser instead of dyz as the default WebDriver browser for WPE. * wpe/WebDriverServiceWPE.cpp: (WebDriver::WebDriverService::platformParseCapabilities const): Tools: Most of the code is based on dyz and gtk MiniBrowser. This patch adds a new internal library WPEToolingBackends, including the headless view backend and a new window backend to be used by the MiniBrowser. MiniBrowser can also run in headless mode, by using the headless backend instead of the window one, which will allow us to run the WebDriver tests in the bots. * CMakeLists.txt: * MiniBrowser/wpe/CMakeLists.txt: Added. * MiniBrowser/wpe/main.cpp: Added. (automationStartedCallback): (createViewBackend): (main): * Scripts/run-minibrowser: Remove WPE specific code. * Scripts/run-webdriver-tests: Add headless display-server option. * Scripts/webkitdirs.pm: (launcherName): Remove WPE specific code. * Scripts/webkitpy/webdriver_tests/webdriver_driver_wpe.py: (WebDriverWPE.browser_name): Return MiniBrowser. (WebDriverWPE.browser_path): Return the path to the MiniBrowser in build dir. (WebDriverWPE.browser_args): Add --headless when running in headless mode. (WebDriverWPE.capabilities): Use the full browser path. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner_selenium.py: (WebDriverTestRunnerSelenium.collect_tests): Fix early return value. * TestWebKitAPI/PlatformWPE.cmake: Use WPEToolingBackends instead of HeadlessViewBackend. * TestWebKitAPI/PlatformWebView.h: Ditto. * TestWebKitAPI/glib/PlatformWPE.cmake: Ditto * TestWebKitAPI/glib/WebKitGLib/TestMain.h: (Test::createWebViewBackend): Ditto. * TestWebKitAPI/wpe/PlatformWebViewWPE.cpp: (TestWebKitAPI::PlatformWebView::initialize): Ditto. * WebKitTestRunner/PlatformWPE.cmake: Ditto. * WebKitTestRunner/PlatformWebView.h: Ditto. * WebKitTestRunner/wpe/PlatformWebViewWPE.cpp: (WTR::PlatformWebView::PlatformWebView): Ditto. * wpe/HeadlessViewBackend/CMakeLists.txt: Removed. * wpe/backends/CMakeLists.txt: Added. * wpe/backends/HeadlessViewBackend.cpp: Renamed from Tools/wpe/HeadlessViewBackend/HeadlessViewBackend.cpp. (WPEToolingBackends::getEGLDisplay): (WPEToolingBackends::HeadlessViewBackend::HeadlessViewBackend): (WPEToolingBackends::HeadlessViewBackend::~HeadlessViewBackend): (WPEToolingBackends::HeadlessViewBackend::createSnapshot): (WPEToolingBackends::HeadlessViewBackend::performUpdate): (WPEToolingBackends::HeadlessViewBackend::displayBuffer): * wpe/backends/HeadlessViewBackend.h: Renamed from Tools/wpe/HeadlessViewBackend/HeadlessViewBackend.h. * wpe/backends/ViewBackend.cpp: Added. (WPEToolingBackends::ViewBackend::ViewBackend): (WPEToolingBackends::ViewBackend::~ViewBackend): (WPEToolingBackends::ViewBackend::initialize): (WPEToolingBackends::ViewBackend::setInputClient): (WPEToolingBackends::ViewBackend::backend const): (WPEToolingBackends::ViewBackend::dispatchInputPointerEvent): (WPEToolingBackends::ViewBackend::dispatchInputAxisEvent): (WPEToolingBackends::ViewBackend::dispatchInputKeyboardEvent): * wpe/backends/ViewBackend.h: Added. * wpe/backends/WindowViewBackend.cpp: Added. (WPEToolingBackends::WindowViewBackend::WindowViewBackend): (WPEToolingBackends::WindowViewBackend::~WindowViewBackend): (WPEToolingBackends::WindowViewBackend::displayBuffer): (WPEToolingBackends::WindowViewBackend::handleKeyEvent): * wpe/backends/WindowViewBackend.h: Added. * wpe/jhbuild.modules: Remove dyz and add wayland-protocols. Canonical link: https://commits.webkit.org/201827@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232670 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-06-11 06:43:14 +00:00
'"weston": Use a virtualized Weston server. "wayland": Use the current wayland session.'
'"headless": Headless mode in current session')
WebDriver: Add support to import and run W3C tests https://bugs.webkit.org/show_bug.cgi?id=177304 Reviewed by Brian Burg. Tools: WPT has now several WebDriver tests, and new ones are going to be added to cover the whole spec. This patch adds the initial support for running W3C tests. The script import-w3c-webdriver-tests reuses parts of the W3C test downloader to download the tests and required tools from WPT repository into WebDriverTests directory. Tests can be run with run-webdriver-tests, a new script that works similar to other test runner scripts. For now it shows a summary at the end of the execution, there aren't expectations yet, since we are not ready to run those tests in the bots. Once we are ready to properly run the tests, we can add the expectations support and run the tests in the bots. * Scripts/import-w3c-webdriver-tests: Added. * Scripts/run-webdriver-tests: Added. * Scripts/webkitpy/style/checker.py: Skip WebDriverTests directory since it only contains third-party python code. * Scripts/webkitpy/thirdparty/__init__.py: Add support to autodownload mozlog and mozprocess since they are required by the WebDriver tests. * Scripts/webkitpy/webdriver_tests/__init__.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_driver.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_driver_gtk.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_result.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_w3c_web_server.py: Added. WebDriverTests: Add json file used by the importer and the result of running the importer. * imported/w3c/importer.json: Added. * imported/w3c/tools/pytest/: Added. * imported/w3c/tools/webdriver/: Added. * imported/w3c/tools/wptrunner/: Added. * imported/w3c/webdriver/: Added. Canonical link: https://commits.webkit.org/195008@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-26 10:58:17 +00:00
options, args = option_parser.parse_args()
configure_logging(logging.DEBUG if options.verbose else logging.INFO)
try:
port = Host().port_factory.get(options.platform, options)
except NotImplementedError as e:
WebDriver: Add support to import and run W3C tests https://bugs.webkit.org/show_bug.cgi?id=177304 Reviewed by Brian Burg. Tools: WPT has now several WebDriver tests, and new ones are going to be added to cover the whole spec. This patch adds the initial support for running W3C tests. The script import-w3c-webdriver-tests reuses parts of the W3C test downloader to download the tests and required tools from WPT repository into WebDriverTests directory. Tests can be run with run-webdriver-tests, a new script that works similar to other test runner scripts. For now it shows a summary at the end of the execution, there aren't expectations yet, since we are not ready to run those tests in the bots. Once we are ready to properly run the tests, we can add the expectations support and run the tests in the bots. * Scripts/import-w3c-webdriver-tests: Added. * Scripts/run-webdriver-tests: Added. * Scripts/webkitpy/style/checker.py: Skip WebDriverTests directory since it only contains third-party python code. * Scripts/webkitpy/thirdparty/__init__.py: Add support to autodownload mozlog and mozprocess since they are required by the WebDriver tests. * Scripts/webkitpy/webdriver_tests/__init__.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_driver.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_driver_gtk.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_result.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_w3c_web_server.py: Added. WebDriverTests: Add json file used by the importer and the result of running the importer. * imported/w3c/importer.json: Added. * imported/w3c/tools/pytest/: Added. * imported/w3c/tools/webdriver/: Added. * imported/w3c/tools/wptrunner/: Added. * imported/w3c/webdriver/: Added. Canonical link: https://commits.webkit.org/195008@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-26 10:58:17 +00:00
_log.error(str(e))
sys.exit(-1)
WebDriver: Add support to import and run W3C tests https://bugs.webkit.org/show_bug.cgi?id=177304 Reviewed by Brian Burg. Tools: WPT has now several WebDriver tests, and new ones are going to be added to cover the whole spec. This patch adds the initial support for running W3C tests. The script import-w3c-webdriver-tests reuses parts of the W3C test downloader to download the tests and required tools from WPT repository into WebDriverTests directory. Tests can be run with run-webdriver-tests, a new script that works similar to other test runner scripts. For now it shows a summary at the end of the execution, there aren't expectations yet, since we are not ready to run those tests in the bots. Once we are ready to properly run the tests, we can add the expectations support and run the tests in the bots. * Scripts/import-w3c-webdriver-tests: Added. * Scripts/run-webdriver-tests: Added. * Scripts/webkitpy/style/checker.py: Skip WebDriverTests directory since it only contains third-party python code. * Scripts/webkitpy/thirdparty/__init__.py: Add support to autodownload mozlog and mozprocess since they are required by the WebDriver tests. * Scripts/webkitpy/webdriver_tests/__init__.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_driver.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_driver_gtk.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_result.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_w3c_web_server.py: Added. WebDriverTests: Add json file used by the importer and the result of running the importer. * imported/w3c/importer.json: Added. * imported/w3c/tools/pytest/: Added. * imported/w3c/tools/webdriver/: Added. * imported/w3c/tools/wptrunner/: Added. * imported/w3c/webdriver/: Added. Canonical link: https://commits.webkit.org/195008@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-26 10:58:17 +00:00
if port.name() in ['gtk', 'wpe']:
import os
[GTK][WPE]: Add a way to setup our development environment inside flatpak https://bugs.webkit.org/show_bug.cgi?id=186771 Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-06-29 Reviewed by Carlos Alberto Lopez Perez. Tools: This patch introduce a way to setup the development environment inside flatpak[0] removing the need for jhbuild when doing so. Anything needed to build/run minibrowser/ run layout tests is provided either but the org.gnome.Sdk runtime or built with flatpak-builder. The workflow is very similar to the "jhbuild based" one except that you should use update-webkit$PORTNAME-flatpak instead of update-webkit$PORTNAME-libs and that script requires to specify a build configuration (--release is default). Our scripts have been updated to be able to run inside that new build environment. Since everything runs inside a flatpak sandbox, gdb needs to be run from within the sandbox, the script exposes a way to do it easily with the `--gdb` option: $ webkit-flatpak --gdb [-m COREDUMPCTL MATCHES] The Layout test `GDBCrashLogGenerator` has been taugth how to use that and is able to retrieve stacktrace as with the jhbuild based workflow. [0] http://flatpak.org * Scripts/build-webkit: * Scripts/generate-jsc-bundle: (main): * Scripts/run-gtk-tests: * Scripts/run-minibrowser: * Scripts/run-webdriver-tests: * Scripts/run-webkit-tests: * Scripts/run-wpe-tests: * Scripts/update-webkitgtk-libs: * Scripts/update-webkitwpe-libs: * Scripts/webkit-flatpak: Added. * Scripts/webkitdirs.pm: (getJhbuildPath): (getFlatpakPath): (inFlatpakSandbox): (runInFlatpak): (runInFlatpakIfAvalaible): (wrapperPrefixIfNeeded): (shouldUseFlatpak): * Scripts/webkitpy/port/base.py: (Port._path_to_apache): (Port._is_flatpak): (Port._apache_config_file_name_for_platform): (Port._should_use_flatpak): (Port): (Port._in_flatpak_sandbox): (Port._should_use_jhbuild): * Scripts/webkitpy/port/gtk.py: (GtkPort.setup_environ_for_server): * Scripts/webkitpy/port/linux_get_crash_log.py: (GDBCrashLogGenerator._get_trace_from_systemd): (GDBCrashLogGenerator.generate_crash_log): * Scripts/webkitpy/port/wpe.py: (WPEPort.setup_environ_for_server): * Scripts/webkitpy/w3c/wpt_runner.py: (main): * flatpak/files/default.xkm: Added. * flatpak/files/httpd-autogen.sh: Added. * flatpak/flatpakutils.py: Added. (Colors): (Console): (Console.message): (remove_extension_points): (remove_comments): (remove_comments._replacer): (load_manifest): (expand_manifest): (FlatpakObject): (FlatpakObject.__init__): (FlatpakObject.flatpak): (FlatpakPackages): (FlatpakPackages.__init__): (FlatpakPackages.__detect_packages): (FlatpakPackages.__detect_packages.in): (FlatpakPackages.__detect_runtimes): (FlatpakPackages.__detect_apps): (FlatpakPackages.__iter__): (FlatpakRepos): (FlatpakRepos.__init__): (FlatpakRepos.update): (FlatpakRepos.add): (FlatpakRepo): (FlatpakRepo.__init__): (FlatpakRepo.repo_file): (FlatpakPackage): (FlatpakPackage.__init__): (FlatpakPackage.__str__): (FlatpakPackage.is_installed): (FlatpakPackage.install): (FlatpakPackage.update): (WebkitFlatpak): (WebkitFlatpak.load_from_args): (WebkitFlatpak.__init__): (WebkitFlatpak.check_flatpak): (WebkitFlatpak.check_flatpak.comparable_version): (WebkitFlatpak.clean_args): (WebkitFlatpak.run_in_sandbox): (WebkitFlatpak.run): (WebkitFlatpak.has_environment): (WebkitFlatpak.setup_dev_env): (WebkitFlatpak.install_all): (WebkitFlatpak.run_gdb): (WebkitFlatpak.update_all): (is_sandboxed): (run_in_sandbox_if_available): * flatpak/org.webkit.GTK.yaml: Added. * flatpak/org.webkit.WPE.yaml: Added. * flatpak/org.webkit.WebKit.yaml: Added. * flatpak/patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch: Added. * flatpak/patches/xvfb-0001-HACK-Avoid-compiling-a-kbm-file.patch: Added. LayoutTests: * http/conf/flatpak-httpd.conf: Added. Apache configuration file to be used inside flaptak. Canonical link: https://commits.webkit.org/202447@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233362 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-06-29 17:47:17 +00:00
top_level_directory = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..'))
[GTK][WPE]: Add a way to setup our development environment inside flatpak https://bugs.webkit.org/show_bug.cgi?id=186771 Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-06-29 Reviewed by Carlos Alberto Lopez Perez. Tools: This patch introduce a way to setup the development environment inside flatpak[0] removing the need for jhbuild when doing so. Anything needed to build/run minibrowser/ run layout tests is provided either but the org.gnome.Sdk runtime or built with flatpak-builder. The workflow is very similar to the "jhbuild based" one except that you should use update-webkit$PORTNAME-flatpak instead of update-webkit$PORTNAME-libs and that script requires to specify a build configuration (--release is default). Our scripts have been updated to be able to run inside that new build environment. Since everything runs inside a flatpak sandbox, gdb needs to be run from within the sandbox, the script exposes a way to do it easily with the `--gdb` option: $ webkit-flatpak --gdb [-m COREDUMPCTL MATCHES] The Layout test `GDBCrashLogGenerator` has been taugth how to use that and is able to retrieve stacktrace as with the jhbuild based workflow. [0] http://flatpak.org * Scripts/build-webkit: * Scripts/generate-jsc-bundle: (main): * Scripts/run-gtk-tests: * Scripts/run-minibrowser: * Scripts/run-webdriver-tests: * Scripts/run-webkit-tests: * Scripts/run-wpe-tests: * Scripts/update-webkitgtk-libs: * Scripts/update-webkitwpe-libs: * Scripts/webkit-flatpak: Added. * Scripts/webkitdirs.pm: (getJhbuildPath): (getFlatpakPath): (inFlatpakSandbox): (runInFlatpak): (runInFlatpakIfAvalaible): (wrapperPrefixIfNeeded): (shouldUseFlatpak): * Scripts/webkitpy/port/base.py: (Port._path_to_apache): (Port._is_flatpak): (Port._apache_config_file_name_for_platform): (Port._should_use_flatpak): (Port): (Port._in_flatpak_sandbox): (Port._should_use_jhbuild): * Scripts/webkitpy/port/gtk.py: (GtkPort.setup_environ_for_server): * Scripts/webkitpy/port/linux_get_crash_log.py: (GDBCrashLogGenerator._get_trace_from_systemd): (GDBCrashLogGenerator.generate_crash_log): * Scripts/webkitpy/port/wpe.py: (WPEPort.setup_environ_for_server): * Scripts/webkitpy/w3c/wpt_runner.py: (main): * flatpak/files/default.xkm: Added. * flatpak/files/httpd-autogen.sh: Added. * flatpak/flatpakutils.py: Added. (Colors): (Console): (Console.message): (remove_extension_points): (remove_comments): (remove_comments._replacer): (load_manifest): (expand_manifest): (FlatpakObject): (FlatpakObject.__init__): (FlatpakObject.flatpak): (FlatpakPackages): (FlatpakPackages.__init__): (FlatpakPackages.__detect_packages): (FlatpakPackages.__detect_packages.in): (FlatpakPackages.__detect_runtimes): (FlatpakPackages.__detect_apps): (FlatpakPackages.__iter__): (FlatpakRepos): (FlatpakRepos.__init__): (FlatpakRepos.update): (FlatpakRepos.add): (FlatpakRepo): (FlatpakRepo.__init__): (FlatpakRepo.repo_file): (FlatpakPackage): (FlatpakPackage.__init__): (FlatpakPackage.__str__): (FlatpakPackage.is_installed): (FlatpakPackage.install): (FlatpakPackage.update): (WebkitFlatpak): (WebkitFlatpak.load_from_args): (WebkitFlatpak.__init__): (WebkitFlatpak.check_flatpak): (WebkitFlatpak.check_flatpak.comparable_version): (WebkitFlatpak.clean_args): (WebkitFlatpak.run_in_sandbox): (WebkitFlatpak.run): (WebkitFlatpak.has_environment): (WebkitFlatpak.setup_dev_env): (WebkitFlatpak.install_all): (WebkitFlatpak.run_gdb): (WebkitFlatpak.update_all): (is_sandboxed): (run_in_sandbox_if_available): * flatpak/org.webkit.GTK.yaml: Added. * flatpak/org.webkit.WPE.yaml: Added. * flatpak/org.webkit.WebKit.yaml: Added. * flatpak/patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch: Added. * flatpak/patches/xvfb-0001-HACK-Avoid-compiling-a-kbm-file.patch: Added. LayoutTests: * http/conf/flatpak-httpd.conf: Added. Apache configuration file to be used inside flaptak. Canonical link: https://commits.webkit.org/202447@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233362 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-06-29 17:47:17 +00:00
sys.path.insert(0, os.path.join(top_level_directory, 'Tools', 'flatpak'))
import flatpakutils
flatpakutils.run_in_sandbox_if_available(sys.argv)
if not flatpakutils.is_sandboxed():
sys.path.insert(0, os.path.join(top_level_directory, 'Tools', 'jhbuild'))
import jhbuildutils
[GTK][WPE]: Add a way to setup our development environment inside flatpak https://bugs.webkit.org/show_bug.cgi?id=186771 Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-06-29 Reviewed by Carlos Alberto Lopez Perez. Tools: This patch introduce a way to setup the development environment inside flatpak[0] removing the need for jhbuild when doing so. Anything needed to build/run minibrowser/ run layout tests is provided either but the org.gnome.Sdk runtime or built with flatpak-builder. The workflow is very similar to the "jhbuild based" one except that you should use update-webkit$PORTNAME-flatpak instead of update-webkit$PORTNAME-libs and that script requires to specify a build configuration (--release is default). Our scripts have been updated to be able to run inside that new build environment. Since everything runs inside a flatpak sandbox, gdb needs to be run from within the sandbox, the script exposes a way to do it easily with the `--gdb` option: $ webkit-flatpak --gdb [-m COREDUMPCTL MATCHES] The Layout test `GDBCrashLogGenerator` has been taugth how to use that and is able to retrieve stacktrace as with the jhbuild based workflow. [0] http://flatpak.org * Scripts/build-webkit: * Scripts/generate-jsc-bundle: (main): * Scripts/run-gtk-tests: * Scripts/run-minibrowser: * Scripts/run-webdriver-tests: * Scripts/run-webkit-tests: * Scripts/run-wpe-tests: * Scripts/update-webkitgtk-libs: * Scripts/update-webkitwpe-libs: * Scripts/webkit-flatpak: Added. * Scripts/webkitdirs.pm: (getJhbuildPath): (getFlatpakPath): (inFlatpakSandbox): (runInFlatpak): (runInFlatpakIfAvalaible): (wrapperPrefixIfNeeded): (shouldUseFlatpak): * Scripts/webkitpy/port/base.py: (Port._path_to_apache): (Port._is_flatpak): (Port._apache_config_file_name_for_platform): (Port._should_use_flatpak): (Port): (Port._in_flatpak_sandbox): (Port._should_use_jhbuild): * Scripts/webkitpy/port/gtk.py: (GtkPort.setup_environ_for_server): * Scripts/webkitpy/port/linux_get_crash_log.py: (GDBCrashLogGenerator._get_trace_from_systemd): (GDBCrashLogGenerator.generate_crash_log): * Scripts/webkitpy/port/wpe.py: (WPEPort.setup_environ_for_server): * Scripts/webkitpy/w3c/wpt_runner.py: (main): * flatpak/files/default.xkm: Added. * flatpak/files/httpd-autogen.sh: Added. * flatpak/flatpakutils.py: Added. (Colors): (Console): (Console.message): (remove_extension_points): (remove_comments): (remove_comments._replacer): (load_manifest): (expand_manifest): (FlatpakObject): (FlatpakObject.__init__): (FlatpakObject.flatpak): (FlatpakPackages): (FlatpakPackages.__init__): (FlatpakPackages.__detect_packages): (FlatpakPackages.__detect_packages.in): (FlatpakPackages.__detect_runtimes): (FlatpakPackages.__detect_apps): (FlatpakPackages.__iter__): (FlatpakRepos): (FlatpakRepos.__init__): (FlatpakRepos.update): (FlatpakRepos.add): (FlatpakRepo): (FlatpakRepo.__init__): (FlatpakRepo.repo_file): (FlatpakPackage): (FlatpakPackage.__init__): (FlatpakPackage.__str__): (FlatpakPackage.is_installed): (FlatpakPackage.install): (FlatpakPackage.update): (WebkitFlatpak): (WebkitFlatpak.load_from_args): (WebkitFlatpak.__init__): (WebkitFlatpak.check_flatpak): (WebkitFlatpak.check_flatpak.comparable_version): (WebkitFlatpak.clean_args): (WebkitFlatpak.run_in_sandbox): (WebkitFlatpak.run): (WebkitFlatpak.has_environment): (WebkitFlatpak.setup_dev_env): (WebkitFlatpak.install_all): (WebkitFlatpak.run_gdb): (WebkitFlatpak.update_all): (is_sandboxed): (run_in_sandbox_if_available): * flatpak/org.webkit.GTK.yaml: Added. * flatpak/org.webkit.WPE.yaml: Added. * flatpak/org.webkit.WebKit.yaml: Added. * flatpak/patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch: Added. * flatpak/patches/xvfb-0001-HACK-Avoid-compiling-a-kbm-file.patch: Added. LayoutTests: * http/conf/flatpak-httpd.conf: Added. Apache configuration file to be used inside flaptak. Canonical link: https://commits.webkit.org/202447@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233362 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-06-29 17:47:17 +00:00
if not jhbuildutils.enter_jhbuild_environment_if_available(port.name()):
print('***')
print('*** Warning: jhbuild environment not present and not running in flatpak.')
print('*** Run update-webkitgtk-libs or update-webkit-flatpak before build-webkit to ensure proper testing..')
print('***')
WebDriver: Add support to import and run W3C tests https://bugs.webkit.org/show_bug.cgi?id=177304 Reviewed by Brian Burg. Tools: WPT has now several WebDriver tests, and new ones are going to be added to cover the whole spec. This patch adds the initial support for running W3C tests. The script import-w3c-webdriver-tests reuses parts of the W3C test downloader to download the tests and required tools from WPT repository into WebDriverTests directory. Tests can be run with run-webdriver-tests, a new script that works similar to other test runner scripts. For now it shows a summary at the end of the execution, there aren't expectations yet, since we are not ready to run those tests in the bots. Once we are ready to properly run the tests, we can add the expectations support and run the tests in the bots. * Scripts/import-w3c-webdriver-tests: Added. * Scripts/run-webdriver-tests: Added. * Scripts/webkitpy/style/checker.py: Skip WebDriverTests directory since it only contains third-party python code. * Scripts/webkitpy/thirdparty/__init__.py: Add support to autodownload mozlog and mozprocess since they are required by the WebDriver tests. * Scripts/webkitpy/webdriver_tests/__init__.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_driver.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_driver_gtk.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_result.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_w3c_web_server.py: Added. WebDriverTests: Add json file used by the importer and the result of running the importer. * imported/w3c/importer.json: Added. * imported/w3c/tools/pytest/: Added. * imported/w3c/tools/webdriver/: Added. * imported/w3c/tools/wptrunner/: Added. * imported/w3c/webdriver/: Added. Canonical link: https://commits.webkit.org/195008@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-26 10:58:17 +00:00
runner = WebDriverTestRunner(port)
WebDriver: add support for test expectations https://bugs.webkit.org/show_bug.cgi?id=180420 Reviewed by Carlos Alberto Lopez Perez. Tools: Add support for parsing test expectations from a JSON file and mark tests on collection accordingly. * Scripts/run-webdriver-tests: Get the retval from process_results(). * Scripts/webkitpy/thirdparty/__init__.py: (AutoinstallImportHook._install_pytest): Install also py because pytest needs it. * Scripts/webkitpy/webdriver_tests/pytest_runner.py: (TestExpectationsMarker): Plugin to mark tests based on given expectations. (TestExpectationsMarker.__init__): Initialize expectations. (TestExpectationsMarker.pytest_collection_modifyitems): Mark tests if needed, (run): Create and use TestExpectationsMarker plugin. * Scripts/webkitpy/webdriver_tests/webdriver_selenium_executor.py: (WebDriverSeleniumExecutor.run): Pass expectations to pytest_runner. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py: (WebDriverTestRunner.__init__): Create a TestExpectations and pass it to the runners. (WebDriverTestRunner.run): Do not count results here. (WebDriverTestRunner.process_results): Rename print_results() as process_results() since it now returns the amount of failures. Printing the test summary while processing results will be made optional in a follow up patch. (WebDriverTestRunner.process_results.report): Return the amount of failures. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner_selenium.py: (WebDriverTestRunnerSelenium.__init__): Initialize _expectations. (WebDriverTestRunnerSelenium.collect_tests): Do not include skipped tests. (WebDriverTestRunnerSelenium.run): Stop returning the tests count. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py: (WebDriverTestRunnerW3C.__init__): Initialize _expectations. (WebDriverTestRunnerW3C.collect_tests): Do not include skipped tests. (WebDriverTestRunnerW3C._scan_directory): Ditto. (WebDriverTestRunnerW3C.run): Stop returning the tests count. * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: (WebDriverW3CExecutor.run): Pass expectations to pytest_runner. WebDriverTests: Add initial test expectations. For now I'm only adding the W3C test expectations, selenium ones will be added in a follow up patch. * TestExpectations.json: Added. Canonical link: https://commits.webkit.org/197570@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227064 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-17 11:23:58 +00:00
runner.run(args)
[GTK] WebDriver: tests step always times out in the bot https://bugs.webkit.org/show_bug.cgi?id=182437 Reviewed by Carlos Alberto Lopez Perez. The process itself is not timing out, but the buildbot step is. This is because we are leaking the Xvfb processes. We should ensure that only one driver is executed and it's stopped before the process finishes. * Scripts/run-webdriver-tests: Call teardown() after run(). * Scripts/webkitpy/webdriver_tests/webdriver_selenium_executor.py: (WebDriverSeleniumExecutor.__init__): Receive the env directly instead of the display driver. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py: (WebDriverTestRunner.__init__): Use the driver class directly instead of using the DriverProxy. Get the env from the display driver once and pass it to the test runners. (WebDriverTestRunner.teardown): Stop the display server. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner_selenium.py: (WebDriverTestRunnerSelenium.__init__): Receive the env directly instead of the display driver. (WebDriverTestRunnerSelenium.collect_tests): Pass the env to the executor. (WebDriverTestRunnerSelenium.run): Ditto. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py: (WebDriverTestRunnerW3C.__init__): Receive the env directly instead of the display driver. (WebDriverTestRunnerW3C.run): Pass the env to the executor. * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: (WebDriverW3CExecutor.__init__): Receive the env directly instead of the display driver. Canonical link: https://commits.webkit.org/198232@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 17:25:24 +00:00
runner.teardown()
WebDriver: add support for test expectations https://bugs.webkit.org/show_bug.cgi?id=180420 Reviewed by Carlos Alberto Lopez Perez. Tools: Add support for parsing test expectations from a JSON file and mark tests on collection accordingly. * Scripts/run-webdriver-tests: Get the retval from process_results(). * Scripts/webkitpy/thirdparty/__init__.py: (AutoinstallImportHook._install_pytest): Install also py because pytest needs it. * Scripts/webkitpy/webdriver_tests/pytest_runner.py: (TestExpectationsMarker): Plugin to mark tests based on given expectations. (TestExpectationsMarker.__init__): Initialize expectations. (TestExpectationsMarker.pytest_collection_modifyitems): Mark tests if needed, (run): Create and use TestExpectationsMarker plugin. * Scripts/webkitpy/webdriver_tests/webdriver_selenium_executor.py: (WebDriverSeleniumExecutor.run): Pass expectations to pytest_runner. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py: (WebDriverTestRunner.__init__): Create a TestExpectations and pass it to the runners. (WebDriverTestRunner.run): Do not count results here. (WebDriverTestRunner.process_results): Rename print_results() as process_results() since it now returns the amount of failures. Printing the test summary while processing results will be made optional in a follow up patch. (WebDriverTestRunner.process_results.report): Return the amount of failures. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner_selenium.py: (WebDriverTestRunnerSelenium.__init__): Initialize _expectations. (WebDriverTestRunnerSelenium.collect_tests): Do not include skipped tests. (WebDriverTestRunnerSelenium.run): Stop returning the tests count. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py: (WebDriverTestRunnerW3C.__init__): Initialize _expectations. (WebDriverTestRunnerW3C.collect_tests): Do not include skipped tests. (WebDriverTestRunnerW3C._scan_directory): Ditto. (WebDriverTestRunnerW3C.run): Stop returning the tests count. * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: (WebDriverW3CExecutor.run): Pass expectations to pytest_runner. WebDriverTests: Add initial test expectations. For now I'm only adding the W3C test expectations, selenium ones will be added in a follow up patch. * TestExpectations.json: Added. Canonical link: https://commits.webkit.org/197570@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227064 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-17 11:23:58 +00:00
retval = runner.process_results()
WebDriver: Add support to import and run W3C tests https://bugs.webkit.org/show_bug.cgi?id=177304 Reviewed by Brian Burg. Tools: WPT has now several WebDriver tests, and new ones are going to be added to cover the whole spec. This patch adds the initial support for running W3C tests. The script import-w3c-webdriver-tests reuses parts of the W3C test downloader to download the tests and required tools from WPT repository into WebDriverTests directory. Tests can be run with run-webdriver-tests, a new script that works similar to other test runner scripts. For now it shows a summary at the end of the execution, there aren't expectations yet, since we are not ready to run those tests in the bots. Once we are ready to properly run the tests, we can add the expectations support and run the tests in the bots. * Scripts/import-w3c-webdriver-tests: Added. * Scripts/run-webdriver-tests: Added. * Scripts/webkitpy/style/checker.py: Skip WebDriverTests directory since it only contains third-party python code. * Scripts/webkitpy/thirdparty/__init__.py: Add support to autodownload mozlog and mozprocess since they are required by the WebDriver tests. * Scripts/webkitpy/webdriver_tests/__init__.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_driver.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_driver_gtk.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_result.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_w3c_web_server.py: Added. WebDriverTests: Add json file used by the importer and the result of running the importer. * imported/w3c/importer.json: Added. * imported/w3c/tools/pytest/: Added. * imported/w3c/tools/webdriver/: Added. * imported/w3c/tools/wptrunner/: Added. * imported/w3c/webdriver/: Added. Canonical link: https://commits.webkit.org/195008@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-26 10:58:17 +00:00
if options.json_output is not None:
runner.dump_results_to_json_file(options.json_output)
sys.exit(retval)
WebDriver: Add support to import and run W3C tests https://bugs.webkit.org/show_bug.cgi?id=177304 Reviewed by Brian Burg. Tools: WPT has now several WebDriver tests, and new ones are going to be added to cover the whole spec. This patch adds the initial support for running W3C tests. The script import-w3c-webdriver-tests reuses parts of the W3C test downloader to download the tests and required tools from WPT repository into WebDriverTests directory. Tests can be run with run-webdriver-tests, a new script that works similar to other test runner scripts. For now it shows a summary at the end of the execution, there aren't expectations yet, since we are not ready to run those tests in the bots. Once we are ready to properly run the tests, we can add the expectations support and run the tests in the bots. * Scripts/import-w3c-webdriver-tests: Added. * Scripts/run-webdriver-tests: Added. * Scripts/webkitpy/style/checker.py: Skip WebDriverTests directory since it only contains third-party python code. * Scripts/webkitpy/thirdparty/__init__.py: Add support to autodownload mozlog and mozprocess since they are required by the WebDriver tests. * Scripts/webkitpy/webdriver_tests/__init__.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_driver.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_driver_gtk.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_result.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: Added. * Scripts/webkitpy/webdriver_tests/webdriver_w3c_web_server.py: Added. WebDriverTests: Add json file used by the importer and the result of running the importer. * imported/w3c/importer.json: Added. * imported/w3c/tools/pytest/: Added. * imported/w3c/tools/webdriver/: Added. * imported/w3c/tools/wptrunner/: Added. * imported/w3c/webdriver/: Added. Canonical link: https://commits.webkit.org/195008@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-26 10:58:17 +00:00