Skip to content

Commit

Permalink
Move WPT tooling from blinkpy/third_party to //third_party
Browse files Browse the repository at this point in the history
This leaves blinkpy with only one remaining third_party entry (pep8).

Changes made:

  * Moved //third_party/blink/tools/blinkpy/third_party/wpt/ to
    //third_party/wpt_tools/.
  * Renamed //third_party/wpt_tools/README.chromium to README.md, and
    copied the relevant parts of
    //third_party/blink/tools/blinkpy/third_party/README.chromium to
    //third_party/wpt_tools/README.chromium
  * Added an OWNERS and DIR_METADATA file for it.
  * Updated BUILD.gn for blink_web_tests, webdriver_tests, and
    wpt_tests_isolate to include the new location.
  * Updated various code locations that referred to the old location of
    WPT tooling.

There will be docs updates that need to follow this CL.

Bug: 1166905
Change-Id: I64b222394aab8964f7719cff648a2a1f858b713b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2644858
Auto-Submit: Stephen McGruer <smcgruer@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Luke Z <lpz@chromium.org>
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#847194}
  • Loading branch information
stephenmcgruer authored and Chromium LUCI CQ committed Jan 26, 2021
1 parent bdbed5c commit 83f2fce
Show file tree
Hide file tree
Showing 398 changed files with 80 additions and 64 deletions.
2 changes: 2 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,7 @@ if (!is_ios) {
"//third_party/blink/web_tests/VirtualTestSuites",
"//third_party/blink/web_tests/WebDriverExpectations",
"//third_party/pywebsocket3/src/mod_pywebsocket/",
"//third_party/wpt_tools/",
]
data_deps = [
"//chrome:chrome",
Expand Down Expand Up @@ -1112,6 +1113,7 @@ if (!is_ios) {
"//third_party/blink/web_tests/wpt_internal/",
"//third_party/pywebsocket3/src/mod_pywebsocket/",
"//third_party/test_fonts/test_fonts/",
"//third_party/wpt_tools/",
]

if (is_win) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ WebTestContentBrowserClient::GetOriginsRequiringDedicatedProcess() {
};

// The list of schemes below is based on
// third_party/blink/tools/blinkpy/third_party/wpt/wpt.config.json
// //third_party/wpt_tools/wpt.config.json
const char* kOriginTemplates[] = {
"http://%s/",
"https://%s/",
Expand Down
4 changes: 2 additions & 2 deletions testing/scripts/run_android_wpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
WPT dependencies in Chromium vpython are found.
If you need more advanced test control, please use the runner located at
//third_party/blink/tools/blinkpy/third_party/wpt/wpt/wpt.
//third_party/wpt_tools/wpt/wpt.
Here's the mapping [isolate script flag] : [wpt flag]
--isolated-script-test-output : --log-chromium
Expand Down Expand Up @@ -45,7 +45,7 @@
SRC_DIR, 'third_party', 'blink', 'tools')
CATAPULT_DIR = os.path.join(SRC_DIR, 'third_party', 'catapult')
DEFAULT_WPT = os.path.join(
BLINK_TOOLS_DIR, 'blinkpy', 'third_party', 'wpt', 'wpt', 'wpt')
SRC_DIR, 'third_party', 'wpt_tools', 'wpt', 'wpt')
PYUTILS = os.path.join(CATAPULT_DIR, 'common', 'py_utils')

if PYUTILS not in sys.path:
Expand Down
2 changes: 1 addition & 1 deletion testing/scripts/run_wpt_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def rest_args(self):

# Here we add all of the arguments required to run WPT tests on Chrome.
rest_args.extend([
"../../third_party/blink/tools/blinkpy/third_party/wpt/wpt/wpt",
"../../third_party/wpt_tools/wpt/wpt",
"--venv=../../",
"--skip-venv-setup",
# TODO(crbug.com/1166741): We should be running WPT under Python 3.
Expand Down
3 changes: 3 additions & 0 deletions third_party/blink/tools/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ group("wpt_tests_isolate") {
"//testing/scripts/wpt_common.py",
"//testing/xvfb.py",

# WPT tooling
"//third_party/wpt_tools/",

# Include blinkpy tools for setting up expectations.
"//third_party/blink/tools/build_wpt_metadata.py",
"//third_party/blink/tools/blinkpy/",
Expand Down
15 changes: 0 additions & 15 deletions third_party/blink/tools/blinkpy/third_party/README.chromium
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,3 @@ Description: Used during presubmit checks and via lint_blinkpy.py.
stylistic issues that pylint doesn't (e.g., warning about blank lines,
various whitespace issues, etc.).
Local Modifications: None

Name: web-platform-tests - Test Suites for Web Platform specifications
Short Name: wpt
URL: https://github.com/web-platform-tests/wpt/
Version: 79d2debce531d115566192dccf70f5d8fb9ced53
License: LICENSES FOR W3C TEST SUITES (https://www.w3.org/Consortium/Legal/2008/03-bsd-license.html)
License File: wpt/wpt/LICENSE.md
Security Critical: no
Description: This includes code for the manifest tool, lint tool, and wptserve.
Used to run all supported web-platform-tests as part of Blink
web tests. The wpt/wpt directory only contains the tools, whereas
web_tests/external/wpt contains the tests. Also see wpt/README.chromium
for more details on maintenance.
Local Modifications:
- Removed all files except for those listed in wpt/WPTIncludeList.
6 changes: 2 additions & 4 deletions third_party/blink/tools/blinkpy/w3c/test_importer_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@

MOCK_WEB_TESTS = '/mock-checkout/' + RELATIVE_WEB_TESTS
MANIFEST_INSTALL_CMD = [
'python3',
'/mock-checkout/third_party/blink/tools/blinkpy/third_party/wpt/wpt/wpt',
'manifest', '-v', '--no-download', '--tests-root',
MOCK_WEB_TESTS + 'external/wpt'
'python3', '/mock-checkout/third_party/wpt_tools/wpt/wpt', 'manifest',
'-v', '--no-download', '--tests-root', MOCK_WEB_TESTS + 'external/wpt'
]


Expand Down
5 changes: 3 additions & 2 deletions third_party/blink/tools/blinkpy/w3c/wpt_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,9 @@ def ensure_manifest(port, path=None):
@staticmethod
def generate_manifest(port, dest_path):
"""Generates MANIFEST.json on the specified directory."""
wpt_exec_path = PathFinder(port.host.filesystem).path_from_blink_tools(
'blinkpy', 'third_party', 'wpt', 'wpt', 'wpt')
wpt_exec_path = PathFinder(
port.host.filesystem).path_from_chromium_base(
'third_party', 'wpt_tools', 'wpt', 'wpt')
cmd = [
port.python3_command(), wpt_exec_path, 'manifest', '-v',
'--no-download', '--tests-root', dest_path
Expand Down
6 changes: 3 additions & 3 deletions third_party/blink/tools/blinkpy/w3c/wpt_manifest_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_ensure_manifest_copies_new_manifest(self):

self.assertEqual(host.executive.calls, [[
'python3',
'/mock-checkout/third_party/blink/tools/blinkpy/third_party/wpt/wpt/wpt',
'/mock-checkout/third_party/wpt_tools/wpt/wpt',
'manifest',
'-v',
'--no-download',
Expand All @@ -49,7 +49,7 @@ def test_ensure_manifest_updates_manifest_if_it_exists(self):

self.assertEqual(host.executive.calls, [[
'python3',
'/mock-checkout/third_party/blink/tools/blinkpy/third_party/wpt/wpt/wpt',
'/mock-checkout/third_party/wpt_tools/wpt/wpt',
'manifest',
'-v',
'--no-download',
Expand All @@ -71,7 +71,7 @@ def test_ensure_manifest_takes_optional_dest(self):
WPTManifest.ensure_manifest(port, 'wpt_internal')
self.assertEqual(host.executive.calls, [[
'python3',
'/mock-checkout/third_party/blink/tools/blinkpy/third_party/wpt/wpt/wpt',
'/mock-checkout/third_party/wpt_tools/wpt/wpt',
'manifest',
'-v',
'--no-download',
Expand Down
2 changes: 1 addition & 1 deletion third_party/blink/tools/blinkpy/web_tests/port/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class Port(object):
WEBDRIVER_SUBTEST_PYTEST_SEPARATOR = '::'

# The following two constants must match. When adding a new WPT root, also
# remember to add an alias rule to third_party/wpt/wpt.config.json.
# remember to add an alias rule to //third_party/wpt_tools/wpt.config.json.
# WPT_DIRS maps WPT roots on the file system to URL prefixes on wptserve.
# The order matters: '/' MUST be the last URL prefix.
WPT_DIRS = collections.OrderedDict([
Expand Down
4 changes: 2 additions & 2 deletions third_party/blink/tools/blinkpy/web_tests/servers/wptserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def __init__(self, port_obj, output_dir):
finder = PathFinder(fs)
path_to_pywebsocket = finder.path_from_chromium_base(
'third_party', 'pywebsocket3', 'src')
self.path_to_wpt_support = finder.path_from_blink_tools(
'blinkpy', 'third_party', 'wpt')
self.path_to_wpt_support = finder.path_from_chromium_base(
'third_party', 'wpt_tools')
path_to_wpt_root = fs.join(self.path_to_wpt_support, 'wpt')
path_to_wpt_tests = fs.abspath(
fs.join(self._port_obj.web_tests_dir(), 'external', 'wpt'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def setUp(self):
self.host = MockHost()
self.port = TestPort(self.host)
self.host.filesystem.write_text_file(
'/mock-checkout/third_party/blink/tools/blinkpy/third_party/wpt/wpt.config.json',
'/mock-checkout/third_party/wpt_tools/wpt.config.json',
'{"ports": {}, "aliases": []}')

# pylint: disable=protected-access
Expand All @@ -27,7 +27,7 @@ def test_init_start_cmd_without_ws_handlers(self):
self.assertEqual(server._start_cmd, [
'python3',
'-u',
'/mock-checkout/third_party/blink/tools/blinkpy/third_party/wpt/wpt/wpt',
'/mock-checkout/third_party/wpt_tools/wpt/wpt',
'serve',
'--config',
server._config_file,
Expand All @@ -43,7 +43,7 @@ def test_init_start_cmd_with_ws_handlers(self):
self.assertEqual(server._start_cmd, [
'python3',
'-u',
'/mock-checkout/third_party/blink/tools/blinkpy/third_party/wpt/wpt/wpt',
'/mock-checkout/third_party/wpt_tools/wpt/wpt',
'serve',
'--config',
server._config_file,
Expand Down
5 changes: 3 additions & 2 deletions third_party/blink/web_tests/external/PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ def _LintWPT(input_api, output_api):
information about the lint tool.
"""
wpt_path = input_api.os_path.join(input_api.PresubmitLocalPath(), 'wpt')
linter_path = input_api.os_path.join(input_api.PresubmitLocalPath(), '..', '..', 'tools', 'blinkpy', 'third_party', 'wpt',
'wpt', 'wpt')
linter_path = input_api.os_path.join(input_api.change.RepositoryRoot(),
'third_party', 'wpt_tools', 'wpt',
'wpt')

paths_in_wpt = []
for abs_path in input_api.AbsoluteLocalPaths():
Expand Down
9 changes: 9 additions & 0 deletions third_party/blink/web_tests/external/PRESUBMIT_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def __init__(self):
self.is_windows = sys.platform == 'win32'
self.environ = os.environ
self.logging = PrintLogger()
self.change = MockChange()

def AbsoluteLocalPaths(self):
return self.affected_paths
Expand All @@ -35,6 +36,14 @@ def AffectedSourceFiles(self, filter_func):
return filter(lambda f: filter_func(f), all_files)


class MockChange(object):
"""A minimal mock Change for our checks."""

def RepositoryRoot(self):
here = os.path.dirname(__file__)
return os.path.abspath(os.path.join(here, '..', '..', '..', '..'))


class PrintLogger(object):
"""A simple logger that just prints log messages."""

Expand Down
4 changes: 4 additions & 0 deletions third_party/wpt_tools/DIR_METADATA
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
monorail: {
component: "Blink>Infra>Ecosystem"
}
team_email: "ecosystem-infra@chromium.org"
2 changes: 2 additions & 0 deletions third_party/wpt_tools/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
smcgruer@chromium.org
lpz@chromium.org
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def _TestWPTManifest(input_api, output_api):
f.close()

wpt_exec_path = input_api.os_path.join(
blink_path, 'tools', 'blinkpy', 'third_party', 'wpt', 'wpt', 'wpt')
input_api.change.RepositoryRoot(), 'third_party', 'wpt_tools', 'wpt', 'wpt')
external_wpt = input_api.os_path.join(
blink_path, 'web_tests', 'external', 'wpt')
try:
Expand Down
14 changes: 14 additions & 0 deletions third_party/wpt_tools/README.chromium
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Name: web-platform-tests - Test Suites for Web Platform specifications
Short Name: wpt
URL: https://github.com/web-platform-tests/wpt/
Version: 79d2debce531d115566192dccf70f5d8fb9ced53
License: LICENSES FOR W3C TEST SUITES (https://www.w3.org/Consortium/Legal/2008/03-bsd-license.html)
License File: NOT_SHIPPED
Security Critical: no
Description: This includes code for the manifest tool, lint tool, and wptserve.
Used to run all supported web-platform-tests as part of Blink
web tests. The wpt/wpt directory only contains the tools, whereas
web_tests/external/wpt contains the tests. Also see wpt/README.chromium
for more details on maintenance.
Local Modifications:
- Removed all files except for those listed in wpt/WPTIncludeList.
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
W3C Web Platform Tests in Blink Web Tests
# W3C Web Platform Tests in Blink Web Tests

Design Doc: https://goo.gl/iXUaZd

This directory contains checked out and reduced code from web-platform-tests
(https://github.com/web-platform-tests/wpt/) required to run WPT tests as part
of Blink's test infrastructure and some maintenance/configuration code.

The third party code lives entirely in the wpt subdirectory:
tools/blinkpy/third_party/wpt/wpt

For licensing, see README.chromium in parent directory
(tools/blinkpy/third_party/README.chromium).
For licensing, see README.chromium

**

Files in this directory (non third-party)

README.chromium
===============
Parseable details on the project name, URL, license, etc.

README.md
=========
This file.

wpt.config.json
Expand All @@ -33,10 +33,10 @@ changing the ports (HTTP/S, WS/S), make sure to also:
checkout.sh
===========
Running this script without arguments will remove the existing checkout
(third_party/wpt/wpt) and perform a fresh one. See "Rolling in WPT" for more.
(//third_party/wpt_tools/wpt) and perform a fresh one. See "Rolling in WPT".

WPTIncludeList
============
==============
The explicit list of files being kept, everything else not on this list is
deleted when running "./checkout.sh reduce". Use this file to control what gets
checked in and try to keep the list as small as possible (use what you need).
Expand All @@ -61,15 +61,14 @@ re-generate them:
3. Look at the "Not After" date in the output of the command, and update
"January 2025" in this document and expiration_date in wptserve.py to new
expiration date.
4. Update certs/127.0.0.1.sxg.*.
4. Update certs/127.0.0.1.sxg.\*.
Please refer to
third_party/blink/web_tests/http/tests/loading/sxg/resources/README.md
//third_party/blink/web_tests/http/tests/loading/sxg/resources/README.md
5. git commit
6. git cl upload, etc.

**

Rolling in WPT
==============

If there are new files that need to be rolled in, add the intended files to
the WPTIncludeList. Ensure these files are in the correct order by running
Expand All @@ -80,10 +79,10 @@ the desired HEAD position. You can then call "./checkout.sh clone" which will
pull in all the code.

It is also important to update the hashes in the 'Version:' fields of
tools/blinkpy/third_party/README.chromium. While you're in this file, look at
the "Local Modifications" section which lists ways in which Chromium has
diverged from WPT. Make sure these modifications are persisted when reviewing
the changes being made.
//third_party/wpt_tools/README.chromium. While you're in this file, look at the
"Local Modifications" section which lists ways in which Chromium has diverged
from WPT. Make sure these modifications are persisted when reviewing the changes
being made.

You can examine what's pulled in and update WPTIncludeList if some new files are
required to run the updated version.
Expand All @@ -94,9 +93,8 @@ remove everything that is not listed in WPTIncludeList.
Note that calling "./checkout.sh" without arguments is equivalent of calling
"./checkout.sh clone reduce".

**

Configuration
=============

Read instructions in WPT README:
https://github.com/web-platform-tests/wpt/blob/master/README.md
Expand All @@ -105,11 +103,10 @@ Also, check out the WPTServe Documentation
(https://wptserve.readthedocs.org/en/latest/).

Note that editing /etc/hosts is not required for run_web_tests.py since
content_shell is invoked with flags to map all *.test domains to 127.0.0.1.

**
content_shell is invoked with flags to map all \*.test domains to 127.0.0.1.

Running web-platform-tests with enabled WPTServe on a local machine
===================================================================

WPTServe is now enabled by default in run_web_tests.py for tests that live in
web_tests/external/wpt.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@
"aliases": [
{
"url-path": "/wpt_internal/",
"local-dir": "../../../../../web_tests/wpt_internal"
"local-dir": "../../blink/web_tests/wpt_internal"
},
{
"url-path": "/wpt_automation/",
"local-dir": "../../../../../web_tests/external/wpt_automation"
"local-dir": "../../blink/web_tests/external/wpt_automation"
},
{
"url-path": "/resources/testharnessreport.js",
"local-dir": "../../../../../web_tests/resources"
"local-dir": "../../blink/web_tests/resources"
},
{
"url-path": "/resources/testdriver-vendor.js",
"local-dir": "../../../../../web_tests/resources"
"local-dir": "../../blink/web_tests/resources"
},
{
"url-path": "/common/vendor-prefix.js",
"local-dir": "../../../../../web_tests/resources"
"local-dir": "../../blink/web_tests/resources"
}
]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 83f2fce

Please sign in to comment.