Revert "regenerate manifest on builders"
This reverts commit c4e4bd9d1a
.
Reason for revert: The build rules for the manifest files don't capture
the dependency on the test files properly; if a new WPT is added, an
incremental build will not cause the manifest to be regenerated.
This showed up as failures in the deterministic builder here:
https://ci.chromium.org/p/chromium/builders/ci/Deterministic%20Fuchsia%20%28dbg%29/8855
https://ci.chromium.org/p/chromium/builders/ci/Deterministic%20Fuchsia%20%28dbg%29/8856
Original change's description:
> regenerate manifest on builders
>
> Previously manifest is regenerated on test bots. Move this to the
> builder so that we don't need to repeat this on every shard, and
> builders are more likely to get an SSD.
>
> Bug: 982208
> Change-Id: Idb3755feaa4249755fb67a3db9069711bf479d7c
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2993382
> Reviewed-by: Dirk Pranke <dpranke@google.com>
> Commit-Queue: Weizhong Xia <weizhong@google.com>
> Cr-Commit-Position: refs/heads/master@{#899294}
Bug: 982208
Change-Id: I56079e4dbb0488effb1ab4c2bb37e87f15a57e48
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3016238
Auto-Submit: Ian Clelland <iclelland@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Ian Clelland <iclelland@chromium.org>
Owners-Override: Ian Clelland <iclelland@chromium.org>
Cr-Commit-Position: refs/heads/master@{#899653}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
66a09ffc55
commit
07ffd02c2b
BUILD.gn
third_party/blink/tools
19
BUILD.gn
19
BUILD.gn
@ -1157,6 +1157,7 @@ if (!is_ios) {
|
||||
"//testing/xvfb.py",
|
||||
"//third_party/blink/tools/",
|
||||
"//third_party/blink/web_tests/VirtualTestSuites",
|
||||
"//third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json",
|
||||
"//third_party/blink/web_tests/external/wpt/common/",
|
||||
"//third_party/blink/web_tests/external/wpt/resources/",
|
||||
"//third_party/blink/web_tests/resources/",
|
||||
@ -1211,7 +1212,6 @@ if (!is_ios) {
|
||||
"--seed",
|
||||
"4",
|
||||
"--debug-rwt-logging",
|
||||
"--no-manifest-update",
|
||||
"--no-show-results",
|
||||
"--zero-tests-executed-ok",
|
||||
"--clobber-old-results",
|
||||
@ -1221,18 +1221,6 @@ if (!is_ios) {
|
||||
"100",
|
||||
]
|
||||
|
||||
# generate manifest at build time
|
||||
action("gen_manifest") {
|
||||
script = "//third_party/blink/tools/gen_manifest.py"
|
||||
|
||||
args = ["--out", "$root_build_dir/gen/"]
|
||||
|
||||
outputs = [
|
||||
"$root_build_dir/gen/external/wpt/MANIFEST.json",
|
||||
"$root_build_dir/gen/wpt_internal/MANIFEST.json"
|
||||
]
|
||||
}
|
||||
|
||||
# https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_tests.md
|
||||
script_test("blink_web_tests") {
|
||||
run_under_python2 = true
|
||||
@ -1240,10 +1228,7 @@ if (!is_ios) {
|
||||
|
||||
args = _common_web_test_args
|
||||
|
||||
data_deps = [ ":blink_web_tests_support_data",
|
||||
":gen_manifest"
|
||||
]
|
||||
|
||||
data_deps = [ ":blink_web_tests_support_data" ]
|
||||
data = [
|
||||
"//third_party/blink/perf_tests/",
|
||||
"//third_party/blink/web_tests/",
|
||||
|
@ -27,11 +27,9 @@ from blinkpy.web_tests.port.android import PRODUCTS_TO_EXPECTATION_FILE_PATHS
|
||||
from blinkpy.web_tests.port.android import ANDROID_DISABLED_TESTS
|
||||
|
||||
MOCK_WEB_TESTS = '/mock-checkout/' + RELATIVE_WEB_TESTS
|
||||
MOCK_GEN = '/mock-checkout/out/Release/gen/'
|
||||
MANIFEST_INSTALL_CMD = [
|
||||
'python3', '/mock-checkout/third_party/wpt_tools/wpt/wpt', 'manifest',
|
||||
'-v', '--no-download', '--tests-root', MOCK_WEB_TESTS + 'external/wpt',
|
||||
'--path', MOCK_GEN + 'external/wpt/MANIFEST.json'
|
||||
'-v', '--no-download', '--tests-root', MOCK_WEB_TESTS + 'external/wpt'
|
||||
]
|
||||
|
||||
|
||||
@ -528,12 +526,7 @@ class TestImporterTest(LoggingTestCase):
|
||||
host.filesystem.write_text_file(
|
||||
MOCK_WEB_TESTS + 'external/wpt/MANIFEST.json', '{}')
|
||||
importer._generate_manifest()
|
||||
install_cmd = [
|
||||
'python3', '/mock-checkout/third_party/wpt_tools/wpt/wpt', 'manifest',
|
||||
'-v', '--no-download', '--tests-root', MOCK_WEB_TESTS + 'external/wpt',
|
||||
'--path', MOCK_WEB_TESTS + 'external/wpt/MANIFEST.json'
|
||||
]
|
||||
self.assertEqual(host.executive.calls, [MANIFEST_INSTALL_CMD, install_cmd])
|
||||
self.assertEqual(host.executive.calls, [MANIFEST_INSTALL_CMD] * 2)
|
||||
self.assertEqual(importer.chromium_git.added_paths,
|
||||
{MOCK_WEB_TESTS + 'external/' + BASE_MANIFEST_NAME})
|
||||
|
||||
|
@ -26,7 +26,6 @@ from blinkpy.web_tests.port.android import PRODUCTS_TO_EXPECTATION_FILE_PATHS
|
||||
from blinkpy.web_tests.port.factory_mock import MockPortFactory
|
||||
|
||||
MOCK_WEB_TESTS = '/mock-checkout/' + RELATIVE_WEB_TESTS
|
||||
MOCK_GEN = '/mock-checkout/out/Release/gen/'
|
||||
|
||||
class WPTExpectationsUpdaterTest(LoggingTestCase):
|
||||
def mock_host(self):
|
||||
@ -825,7 +824,7 @@ class WPTExpectationsUpdaterTest(LoggingTestCase):
|
||||
host.filesystem.maybe_make_directory(
|
||||
port.web_tests_dir(), 'wpt_internal')
|
||||
host.filesystem.copyfile(
|
||||
host.filesystem.join(MOCK_GEN,
|
||||
host.filesystem.join(port.web_tests_dir(),
|
||||
'external', 'wpt', MANIFEST_NAME),
|
||||
host.filesystem.join(port.web_tests_dir(), 'wpt_internal',
|
||||
MANIFEST_NAME))
|
||||
|
@ -102,10 +102,9 @@ class WPTManifest(object):
|
||||
|
||||
@property
|
||||
def wpt_dir(self):
|
||||
if 'external' in self.wpt_manifest_path:
|
||||
return 'external/wpt'
|
||||
else:
|
||||
return 'wpt_internal'
|
||||
return self.host.filesystem.dirname(
|
||||
self.host.filesystem.relpath(
|
||||
self.wpt_manifest_path, self.port.web_tests_dir()))
|
||||
|
||||
def _items_for_file_path(self, path_in_wpt):
|
||||
"""Finds manifest items for the given WPT path.
|
||||
@ -286,21 +285,18 @@ class WPTManifest(object):
|
||||
return self.test_name_to_file.get(url)
|
||||
|
||||
@staticmethod
|
||||
def ensure_manifest(port, path=None, manifest_path=None):
|
||||
def ensure_manifest(port, path=None):
|
||||
"""Regenerates the WPT MANIFEST.json file.
|
||||
|
||||
Args:
|
||||
port: A blinkpy.web_tests.port.Port object.
|
||||
path: The path to a WPT root (relative to web_tests, optional).
|
||||
manifest_path: The path to the new manifest file
|
||||
"""
|
||||
fs = port.host.filesystem
|
||||
if path is None:
|
||||
path = fs.join('external', 'wpt')
|
||||
wpt_path = fs.join(port.web_tests_dir(), path)
|
||||
if manifest_path is None:
|
||||
manifest_path = fs.join(wpt_path, MANIFEST_NAME)
|
||||
fs.maybe_make_directory(fs.dirname(manifest_path))
|
||||
manifest_path = fs.join(wpt_path, MANIFEST_NAME)
|
||||
|
||||
# Unconditionally delete local MANIFEST.json to avoid regenerating the
|
||||
# manifest from scratch (when version is bumped) or invalid/out-of-date
|
||||
@ -321,7 +317,7 @@ class WPTManifest(object):
|
||||
_log.error('Manifest base not found at "%s".',
|
||||
base_manifest_path)
|
||||
|
||||
WPTManifest.generate_manifest(port, wpt_path, manifest_path)
|
||||
WPTManifest.generate_manifest(port, wpt_path)
|
||||
|
||||
if fs.isfile(manifest_path):
|
||||
_log.debug('Manifest generation completed.')
|
||||
@ -332,17 +328,14 @@ class WPTManifest(object):
|
||||
fs.write_text_file(manifest_path, '{}')
|
||||
|
||||
@staticmethod
|
||||
def generate_manifest(port, dest_path, manifest_path=None):
|
||||
def generate_manifest(port, dest_path):
|
||||
"""Generates MANIFEST.json on the specified directory."""
|
||||
if manifest_path is None:
|
||||
fs = port.host.filesystem
|
||||
manifest_path = fs.join(dest_path, MANIFEST_NAME)
|
||||
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, '--path', manifest_path
|
||||
'--no-download', '--tests-root', dest_path
|
||||
]
|
||||
|
||||
# ScriptError will be raised if the command fails.
|
||||
|
@ -31,8 +31,6 @@ class WPTManifestUnitTest(unittest.TestCase):
|
||||
'--no-download',
|
||||
'--tests-root',
|
||||
WEB_TEST_DIR + '/external/wpt',
|
||||
'--path',
|
||||
WEB_TEST_DIR + '/external/wpt/MANIFEST.json'
|
||||
]])
|
||||
|
||||
def test_ensure_manifest_updates_manifest_if_it_exists(self):
|
||||
@ -57,8 +55,6 @@ class WPTManifestUnitTest(unittest.TestCase):
|
||||
'--no-download',
|
||||
'--tests-root',
|
||||
WEB_TEST_DIR + '/external/wpt',
|
||||
'--path',
|
||||
WEB_TEST_DIR + '/external/wpt/MANIFEST.json'
|
||||
]])
|
||||
|
||||
def test_ensure_manifest_raises_exception(self):
|
||||
@ -81,8 +77,6 @@ class WPTManifestUnitTest(unittest.TestCase):
|
||||
'--no-download',
|
||||
'--tests-root',
|
||||
WEB_TEST_DIR + '/wpt_internal',
|
||||
'--path',
|
||||
WEB_TEST_DIR + '/wpt_internal/MANIFEST.json',
|
||||
]])
|
||||
|
||||
def test_does_not_throw_when_missing_some_test_types(self):
|
||||
|
@ -1021,11 +1021,12 @@ class Port(object):
|
||||
assert path in self.WPT_DIRS
|
||||
# Convert '/' to the platform-specific separator.
|
||||
path = self._filesystem.normpath(path)
|
||||
manifest_path = self._build_path('gen', path, MANIFEST_NAME)
|
||||
manifest_path = self._filesystem.join(self.web_tests_dir(), path,
|
||||
MANIFEST_NAME)
|
||||
if not self._filesystem.exists(manifest_path) or self.get_option(
|
||||
'manifest_update', False):
|
||||
_log.debug('Generating MANIFEST.json for %s...', path)
|
||||
WPTManifest.ensure_manifest(self, path, manifest_path)
|
||||
WPTManifest.ensure_manifest(self, path)
|
||||
return WPTManifest(self.host, manifest_path)
|
||||
|
||||
def is_wpt_crash_test(self, test_name):
|
||||
|
@ -779,7 +779,7 @@ class PortTest(LoggingTestCase):
|
||||
port.set_option_default('manifest_update', False)
|
||||
filesystem = port.host.filesystem
|
||||
filesystem.write_text_file(
|
||||
'/mock-checkout/out/Release/gen' + '/external/wpt/MANIFEST.json', '{}')
|
||||
WEB_TEST_DIR + '/external/wpt/MANIFEST.json', '{}')
|
||||
filesystem.clear_written_files()
|
||||
|
||||
port.wpt_manifest('external/wpt')
|
||||
|
@ -530,7 +530,7 @@ def add_manifest_to_mock_filesystem(port):
|
||||
port.set_option_default('manifest_update', False)
|
||||
filesystem = port.host.filesystem
|
||||
filesystem.write_text_file(
|
||||
'/mock-checkout/out/Release/gen' + '/external/wpt/MANIFEST.json',
|
||||
WEB_TEST_DIR + '/external/wpt/MANIFEST.json',
|
||||
json.dumps({
|
||||
'items': {
|
||||
'testharness': {
|
||||
@ -610,7 +610,7 @@ def add_manifest_to_mock_filesystem(port):
|
||||
WEB_TEST_DIR + '/external/wpt/common/blank.html', 'foo')
|
||||
|
||||
filesystem.write_text_file(
|
||||
'/mock-checkout/out/Release/gen' + '/wpt_internal/MANIFEST.json',
|
||||
WEB_TEST_DIR + '/wpt_internal/MANIFEST.json',
|
||||
json.dumps({
|
||||
'items': {
|
||||
'testharness': {
|
||||
|
55
third_party/blink/tools/gen_manifest.py
vendored
55
third_party/blink/tools/gen_manifest.py
vendored
@ -1,55 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2019 The Chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
import argparse
|
||||
import errno
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
SRC_DIR = os.path.abspath(
|
||||
os.path.join(os.path.dirname(__file__),
|
||||
os.pardir, os.pardir, os.pardir))
|
||||
WPT_EXEC_PATH = os.path.join(SRC_DIR, 'third_party', 'wpt_tools', 'wpt', 'wpt')
|
||||
BASE_MANIFEST_PATH = os.path.join(SRC_DIR, 'third_party', 'blink',
|
||||
'web_tests', 'external',
|
||||
'WPT_BASE_MANIFEST_8.json')
|
||||
MANIFEST_NAME = 'MANIFEST.json'
|
||||
|
||||
def maybe_make_directory(path):
|
||||
try:
|
||||
os.makedirs(path)
|
||||
except OSError as error:
|
||||
if error.errno != errno.EEXIST:
|
||||
raise
|
||||
|
||||
def main() :
|
||||
usage = "Generate manifest for web test..."
|
||||
parser = argparse.ArgumentParser(
|
||||
add_help=False, prog='gen_manifest.py', usage=usage)
|
||||
parser.add_argument('--out', required=True,
|
||||
help='Path of the output directory')
|
||||
options = parser.parse_args()
|
||||
if options.out.startswith('//'):
|
||||
options.out = os.path.join(SRC_DIR, options.out[2:])
|
||||
|
||||
WPT_DIRS = ['wpt_internal', 'external/wpt']
|
||||
for path in WPT_DIRS:
|
||||
print('Generating MANIFEST.json for %s...' % path)
|
||||
wpt_path = os.path.join(SRC_DIR, 'third_party',
|
||||
'blink', 'web_tests', path)
|
||||
manifest_path = os.path.join(options.out, path, MANIFEST_NAME)
|
||||
if 'external' in path:
|
||||
maybe_make_directory(os.path.dirname(manifest_path))
|
||||
shutil.copyfile(BASE_MANIFEST_PATH, manifest_path)
|
||||
cmd = [
|
||||
sys.executable, WPT_EXEC_PATH, 'manifest', '-v',
|
||||
'--no-download', '--tests-root', wpt_path, '--path', manifest_path
|
||||
]
|
||||
subprocess.check_output(cmd)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Reference in New Issue
Block a user