Commit 67bc5a9d authored by Dirk Pranke's avatar Dirk Pranke Committed by Commit Bot

Refactor devtools_web_tests, webgpu_blink_web_tests targets.

This converts the two test suites from 'script' tests to
'generated_script' tests, pushing more of the command line logic
into GN targets (and the generated wrapper scripts).

Bug: 816629
Change-Id: I0ebca0c54d61c6c60734147ebfef1673bd262ed7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2462623Reviewed-by: default avatarRobert Ma <robertma@chromium.org>
Reviewed-by: default avatarBen Pastene <bpastene@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Cr-Commit-Position: refs/heads/master@{#815648}
parent 5adb2687
...@@ -1039,13 +1039,6 @@ if (!is_ios) { ...@@ -1039,13 +1039,6 @@ if (!is_ios) {
} }
} }
group("devtools_web_tests") {
testonly = true
deps = [ ":blink_web_tests" ]
data_deps = [ ":blink_web_tests" ]
data = [ "//third_party/devtools-frontend/src/test/webtests/" ]
}
group("blink_web_tests_support_data") { group("blink_web_tests_support_data") {
testonly = true testonly = true
data_deps = [ data_deps = [
...@@ -1145,28 +1138,25 @@ if (!is_ios) { ...@@ -1145,28 +1138,25 @@ if (!is_ios) {
} }
} }
# https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_tests.md _common_web_test_script = "//testing/scripts/run_isolated_script_test.py"
script_test("blink_web_tests") {
script = "//testing/scripts/run_isolated_script_test.py"
args = [ "@WrappedPath(" + _common_web_test_args = [ "@WrappedPath(" + rebase_path(
rebase_path("//third_party/blink/tools/run_web_tests.py", "//third_party/blink/tools/run_web_tests.py",
root_build_dir) + ")" ] root_build_dir) + ")" ]
if (is_debug) { if (is_debug) {
args += [ "--debug" ] _common_web_test_args += [ "--debug" ]
} else { } else {
args += [ "--release" ] _common_web_test_args += [ "--release" ]
} }
if (is_android) { if (is_android) {
args += [ _common_web_test_args += [
"--platform", "--platform",
"android", "android",
] ]
} }
args += [ _common_web_test_args += [
"--seed", "--seed",
"4", "4",
"--no-show-results", "--no-show-results",
...@@ -1178,6 +1168,12 @@ if (!is_ios) { ...@@ -1178,6 +1168,12 @@ if (!is_ios) {
"100", "100",
] ]
# https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_tests.md
script_test("blink_web_tests") {
script = _common_web_test_script
args = _common_web_test_args
data_deps = [ ":blink_web_tests_support_data" ] data_deps = [ ":blink_web_tests_support_data" ]
data = [ data = [
"//third_party/blink/perf_tests/", "//third_party/blink/perf_tests/",
...@@ -1185,11 +1181,31 @@ if (!is_ios) { ...@@ -1185,11 +1181,31 @@ if (!is_ios) {
] ]
} }
generate_wrapper("webgpu_blink_web_tests") { script_test("devtools_web_tests") {
testonly = true # This target differs from :blink_web_tests in that it uses the
wrapper_script = "${root_build_dir}/bin/run_webgpu_blink_web_tests" # same test harness but runs an entirely different set of tests
executable = "//third_party/blink/tools/run_web_tests.py" # and doesn't have a dependency on the web_test directory at all.
executable_args = [ script = _common_web_test_script
args = _common_web_test_args + [
"--layout-test-directory=@WrappedPath(" + rebase_path(
"//third_party/devtools-frontend/src/test/webtests",
root_out_dir) + ")",
"http/tests/devtools",
]
data_deps = [ ":blink_web_tests_support_data" ]
data = [ "//third_party/devtools-frontend/src/test/webtests/" ]
}
script_test("webgpu_blink_web_tests") {
# This target differs from :blink_web_tests in that it uses the same
# test harness and a few additional flags but, more importantly, only runs
# the web_tests/wpt_internal/webgpu tests, so it doesn't have a data
# dependency on the whole web_test directory.
script = _common_web_test_script
args =
_common_web_test_args + [
"--additional-driver-flag=--enable-unsafe-webgpu", "--additional-driver-flag=--enable-unsafe-webgpu",
"--ignore-default-expectations", "--ignore-default-expectations",
"--additional-expectations", "--additional-expectations",
...@@ -1197,19 +1213,6 @@ if (!is_ios) { ...@@ -1197,19 +1213,6 @@ if (!is_ios) {
"--isolated-script-test-filter=wpt_internal/webgpu/*", "--isolated-script-test-filter=wpt_internal/webgpu/*",
] ]
if (is_debug) {
executable_args += [ "--debug" ]
} else {
executable_args += [ "--release" ]
}
if (is_android) {
executable_args += [
"--platform",
"android",
]
}
data_deps = [ ":blink_web_tests_support_data" ] data_deps = [ ":blink_web_tests_support_data" ]
data = [ data = [
"//third_party/blink/web_tests/WebGPUExpectations", "//third_party/blink/web_tests/WebGPUExpectations",
......
...@@ -269,23 +269,12 @@ ...@@ -269,23 +269,12 @@
"type": "additional_compile_target", "type": "additional_compile_target",
}, },
"devtools_web_tests": { "devtools_web_tests": {
"label": "//:devtools_web_tests",
"type": "generated_script",
"args": [ "args": [
"../../third_party/blink/tools/run_web_tests.py",
"--seed",
"4",
"--no-show-results",
"--zero-tests-executed-ok",
"--clobber-old-results",
"--exit-after-n-failures",
"5000",
"--exit-after-n-crashes-or-timeouts",
"100",
"--results-directory", "--results-directory",
"${ISOLATED_OUTDIR}", "${ISOLATED_OUTDIR}",
], ],
"label": "//:devtools_web_tests",
"script": "//testing/scripts/run_isolated_script_test.py",
"type": "script",
}, },
"boringssl_crypto_tests": { "boringssl_crypto_tests": {
"label": "//third_party/boringssl:boringssl_crypto_tests", "label": "//third_party/boringssl:boringssl_crypto_tests",
...@@ -1854,28 +1843,12 @@ ...@@ -1854,28 +1843,12 @@
"type": "junit_test", "type": "junit_test",
}, },
"webgpu_blink_web_tests": { "webgpu_blink_web_tests": {
"label": "//:webgpu_blink_web_tests",
"type": "generated_script",
"args": [ "args": [
"../../third_party/blink/tools/run_web_tests.py",
"--seed",
"4",
"--no-show-results",
"--zero-tests-executed-ok",
"--clobber-old-results",
"--exit-after-n-failures",
"5000",
"--exit-after-n-crashes-or-timeouts",
"100",
"--results-directory", "--results-directory",
"${ISOLATED_OUTDIR}", "${ISOLATED_OUTDIR}",
# WebGPU specific
"--additional-driver-flag=--enable-unsafe-webgpu",
"--ignore-default-expectations",
"--additional-expectations=../../third_party/blink/web_tests/WebGPUExpectations",
"--isolated-script-test-filter=wpt_internal/webgpu/*",
], ],
"label": "//:webgpu_blink_web_tests",
"script": "//testing/scripts/run_isolated_script_test.py",
"type": "script",
}, },
"weblayer_browsertests": { "weblayer_browsertests": {
"label": "//weblayer/test:weblayer_browsertests", "label": "//weblayer/test:weblayer_browsertests",
......
...@@ -1250,6 +1250,7 @@ ...@@ -1250,6 +1250,7 @@
} }
}, },
'webkit_layout_from_devtools': { 'webkit_layout_from_devtools': {
# TODO(crbug.com/816629) - Move these args into //BUILD.gn .
# layout test failures are retried 3 times when '--test-list' is not # layout test failures are retried 3 times when '--test-list' is not
# passed, but 0 times when '--test-list' is passed. We want to always # passed, but 0 times when '--test-list' is passed. We want to always
# retry 3 times, so we explicitly specify it. # retry 3 times, so we explicitly specify it.
...@@ -3121,6 +3122,7 @@ ...@@ -3121,6 +3122,7 @@
'gpu_webgpu_integration_extra_isolated_scripts': { 'gpu_webgpu_integration_extra_isolated_scripts': {
'webgpu_blink_web_tests_with_backend_validation': { 'webgpu_blink_web_tests_with_backend_validation': {
# TODO(crbug.com/816629) - Move these args into //BUILD.gn.
'name': 'webgpu_blink_web_tests_with_backend_validation', 'name': 'webgpu_blink_web_tests_with_backend_validation',
'args': [ 'args': [
'--driver-logging', '--driver-logging',
...@@ -3161,6 +3163,7 @@ ...@@ -3161,6 +3163,7 @@
'gpu_webgpu_integration_isolated_scripts': { 'gpu_webgpu_integration_isolated_scripts': {
'webgpu_blink_web_tests': { 'webgpu_blink_web_tests': {
# TODO(crbug.com/816629) - Move these args into //BUILD.gn.
'name': 'webgpu_blink_web_tests', 'name': 'webgpu_blink_web_tests',
'args': [ 'args': [
'--driver-logging', '--driver-logging',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment