Commit 1f13da7a authored by Dirk Pranke's avatar Dirk Pranke Committed by Commit Bot

Rework command handling for MB generated_scripts.

The 'generated_script' type in MB configs allows the user
to specify an alternative to "bin/run_$target" as the script to
use. However, in order to make things consistent, we really don't
want to support that.

This CL is a first pass at cleanup by removing every case where
script was set to match "bin/run_$target", and then adjusting
the logic in mb.py to supply that.

It also removes a bunch of unnecessary `args` settings where the
setting just matched the default ([]), and updates the doc
comments in gn_isolate_map.pyl.

Bug: 816629
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs
Change-Id: Iedd072c4fc2b53605c0f225152bcc7ee6b80ec5b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2380420Reviewed-by: default avatarBen Pastene <bpastene@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Cr-Commit-Position: refs/heads/master@{#802400}
parent 023dbacc
...@@ -46,8 +46,11 @@ ...@@ -46,8 +46,11 @@
# : the test is a python script; the path to the script is specified in # : the test is a python script; the path to the script is specified in
# the "script" field. # the "script" field.
# "generated_script" # "generated_script"
# : the test is a script generated at build time; the path to the script # : the test is a script generated at build time; the script *should* be
# *relative to the output directory* is specified in the "script" field. # in output_dir/bin/run_$target (or output_dir\bin\run_$target.bat on
# Windows), but an alternative path *may* be specified,
# in the "script" field, as *relative to the output directory*.
# TODO(crbug.com/816629): remove support for "script".
# "unknown" # "unknown"
# : (the default), which indicates that we don't know what the command line # : (the default), which indicates that we don't know what the command line
# needs to be (this is a fatal error). # needs to be (this is a fatal error).
...@@ -58,9 +61,10 @@ ...@@ -58,9 +61,10 @@
# On Windows, ".exe" will be automatically appended if need be, so # On Windows, ".exe" will be automatically appended if need be, so
# the executable name (and target name) should not contain an ".exe". # the executable name (and target name) should not contain an ".exe".
# #
# The optional "args" field can be used to append extra command line # The optional "args" field may be specified for "windowed_test_launcher",
# args onto the command line determined by the "type". If not specified, # "console_test_launcher", and "script"-type tests, and can be used to
# it defaults to an empty list (no extra args). # append extra command line args onto the command line determined by the
# "type". If not specified, it defaults to an empty list (no extra args).
# #
# The optional "label_type" field can be used in conjunction with # The optional "label_type" field can be used in conjunction with
# "type" == "console_test_launcher" or "type" == "windowed_test_launcher" # "type" == "console_test_launcher" or "type" == "windowed_test_launcher"
...@@ -487,7 +491,6 @@ ...@@ -487,7 +491,6 @@
"chrome_sizes": { "chrome_sizes": {
"label": "//chrome/test:chrome_sizes", "label": "//chrome/test:chrome_sizes",
"type": "generated_script", "type": "generated_script",
"script": "bin/run_chrome_sizes",
}, },
"chromedriver": { "chromedriver": {
"label": "//chrome/test/chromedriver:chromedriver", "label": "//chrome/test/chromedriver:chromedriver",
...@@ -647,7 +650,6 @@ ...@@ -647,7 +650,6 @@
"cronet_sizes": { "cronet_sizes": {
"label": "//components/cronet/android:cronet_sizes", "label": "//components/cronet/android:cronet_sizes",
"type": "generated_script", "type": "generated_script",
"script": "bin/run_cronet_sizes",
}, },
"cronet_smoketests_missing_native_library_instrumentation_apk": { "cronet_smoketests_missing_native_library_instrumentation_apk": {
"label": "//components/cronet/android:cronet_smoketests_missing_native_library_instrumentation_apk", "label": "//components/cronet/android:cronet_smoketests_missing_native_library_instrumentation_apk",
...@@ -660,7 +662,6 @@ ...@@ -660,7 +662,6 @@
"cronet_test": { "cronet_test": {
"label": "//components/cronet/ios/test:cronet_test", "label": "//components/cronet/ios/test:cronet_test",
"type": "generated_script", "type": "generated_script",
"script": "bin/run_cronet_test"
}, },
"cronet_test_instrumentation_apk": { "cronet_test_instrumentation_apk": {
"label": "//components/cronet/android:cronet_test_instrumentation_apk", "label": "//components/cronet/android:cronet_test_instrumentation_apk",
...@@ -896,21 +897,15 @@ ...@@ -896,21 +897,15 @@
"type": "windowed_test_launcher", "type": "windowed_test_launcher",
}, },
"ios_chrome_bookmarks_egtests": { "ios_chrome_bookmarks_egtests": {
"args": [],
"label": "//ios/chrome/test/earl_grey:ios_chrome_bookmarks_egtests", "label": "//ios/chrome/test/earl_grey:ios_chrome_bookmarks_egtests",
"script": "bin/run_ios_chrome_bookmarks_egtests",
"type": "generated_script", "type": "generated_script",
}, },
"ios_chrome_integration_egtests": { "ios_chrome_integration_egtests": {
"args": [],
"label": "//ios/chrome/test/earl_grey:ios_chrome_integration_egtests", "label": "//ios/chrome/test/earl_grey:ios_chrome_integration_egtests",
"script": "bin/run_ios_chrome_integration_egtests",
"type": "generated_script", "type": "generated_script",
}, },
"ios_chrome_reading_list_egtests": { "ios_chrome_reading_list_egtests": {
"args": [],
"label": "//ios/chrome/test/earl_grey:ios_chrome_reading_list_egtests", "label": "//ios/chrome/test/earl_grey:ios_chrome_reading_list_egtests",
"script": "bin/run_ios_chrome_reading_list_egtests",
"type": "generated_script", "type": "generated_script",
}, },
"ios_chrome_settings_egtests": { "ios_chrome_settings_egtests": {
...@@ -918,162 +913,110 @@ ...@@ -918,162 +913,110 @@
"--enable-features=ClearSyncedData", "--enable-features=ClearSyncedData",
], ],
"label": "//ios/chrome/test/earl_grey:ios_chrome_settings_egtests", "label": "//ios/chrome/test/earl_grey:ios_chrome_settings_egtests",
"script": "bin/run_ios_chrome_settings_egtests",
"type": "generated_script", "type": "generated_script",
}, },
"ios_chrome_signin_egtests": { "ios_chrome_signin_egtests": {
"args": [],
"label": "//ios/chrome/test/earl_grey:ios_chrome_signin_egtests", "label": "//ios/chrome/test/earl_grey:ios_chrome_signin_egtests",
"script": "bin/run_ios_chrome_signin_egtests",
"type": "generated_script", "type": "generated_script",
}, },
"ios_chrome_translate_egtests": { "ios_chrome_translate_egtests": {
"label": "//ios/chrome/test/earl_grey:ios_chrome_translate_egtests", "label": "//ios/chrome/test/earl_grey:ios_chrome_translate_egtests",
"script": "bin/run_ios_chrome_translate_egtests",
"type": "generated_script", "type": "generated_script",
}, },
"ios_chrome_smoke_egtests": { "ios_chrome_smoke_egtests": {
"args": [],
"label": "//ios/chrome/test/earl_grey:ios_chrome_smoke_egtests", "label": "//ios/chrome/test/earl_grey:ios_chrome_smoke_egtests",
"script": "bin/run_ios_chrome_smoke_egtests",
"type": "generated_script", "type": "generated_script",
}, },
"ios_chrome_ui_egtests": { "ios_chrome_ui_egtests": {
"args": [],
"label": "//ios/chrome/test/earl_grey:ios_chrome_ui_egtests", "label": "//ios/chrome/test/earl_grey:ios_chrome_ui_egtests",
"script": "bin/run_ios_chrome_ui_egtests",
"type": "generated_script", "type": "generated_script",
}, },
"ios_chrome_unittests": { "ios_chrome_unittests": {
"args": [],
"label": "//ios/chrome/test:ios_chrome_unittests", "label": "//ios/chrome/test:ios_chrome_unittests",
"script": "bin/run_ios_chrome_unittests",
"type": "generated_script", "type": "generated_script",
}, },
"ios_chrome_web_egtests": { "ios_chrome_web_egtests": {
"args": [],
"label": "//ios/chrome/test/earl_grey:ios_chrome_web_egtests", "label": "//ios/chrome/test/earl_grey:ios_chrome_web_egtests",
"script": "bin/run_ios_chrome_web_egtests",
"type": "generated_script", "type": "generated_script",
}, },
"ios_chrome_bookmarks_eg2tests_module": { "ios_chrome_bookmarks_eg2tests_module": {
"args": [],
"label": "//ios/chrome/test/earl_grey2:ios_chrome_bookmarks_eg2tests_module", "label": "//ios/chrome/test/earl_grey2:ios_chrome_bookmarks_eg2tests_module",
"script": "bin/run_ios_chrome_bookmarks_eg2tests_module",
"type": "generated_script", "type": "generated_script",
}, },
"ios_chrome_integration_eg2tests_module": { "ios_chrome_integration_eg2tests_module": {
"args": [],
"label": "//ios/chrome/test/earl_grey2:ios_chrome_integration_eg2tests_module", "label": "//ios/chrome/test/earl_grey2:ios_chrome_integration_eg2tests_module",
"script": "bin/run_ios_chrome_integration_eg2tests_module",
"type": "generated_script", "type": "generated_script",
}, },
"ios_chrome_settings_eg2tests_module": { "ios_chrome_settings_eg2tests_module": {
"args": [],
"label": "//ios/chrome/test/earl_grey2:ios_chrome_settings_eg2tests_module", "label": "//ios/chrome/test/earl_grey2:ios_chrome_settings_eg2tests_module",
"script": "bin/run_ios_chrome_settings_eg2tests_module",
"type": "generated_script", "type": "generated_script",
}, },
"ios_chrome_signin_eg2tests_module": { "ios_chrome_signin_eg2tests_module": {
"args": [],
"label": "//ios/chrome/test/earl_grey2:ios_chrome_signin_eg2tests_module", "label": "//ios/chrome/test/earl_grey2:ios_chrome_signin_eg2tests_module",
"script": "bin/run_ios_chrome_signin_eg2tests_module",
"type": "generated_script", "type": "generated_script",
}, },
"ios_chrome_smoke_eg2tests_module": { "ios_chrome_smoke_eg2tests_module": {
"args": [],
"label": "//ios/chrome/test/earl_grey2:ios_chrome_smoke_eg2tests_module", "label": "//ios/chrome/test/earl_grey2:ios_chrome_smoke_eg2tests_module",
"script": "bin/run_ios_chrome_smoke_eg2tests_module",
"type": "generated_script", "type": "generated_script",
}, },
"ios_chrome_ui_eg2tests_module": { "ios_chrome_ui_eg2tests_module": {
"args": [],
"label": "//ios/chrome/test/earl_grey2:ios_chrome_ui_eg2tests_module", "label": "//ios/chrome/test/earl_grey2:ios_chrome_ui_eg2tests_module",
"script": "bin/run_ios_chrome_ui_eg2tests_module",
"type": "generated_script", "type": "generated_script",
}, },
"ios_chrome_web_eg2tests_module": { "ios_chrome_web_eg2tests_module": {
"args": [],
"label": "//ios/chrome/test/earl_grey2:ios_chrome_web_eg2tests_module", "label": "//ios/chrome/test/earl_grey2:ios_chrome_web_eg2tests_module",
"script": "bin/run_ios_chrome_web_eg2tests_module",
"type": "generated_script", "type": "generated_script",
}, },
"ios_crash_xcuitests_module": { "ios_crash_xcuitests_module": {
"args": [],
"label": "//third_party/crashpad/crashpad/test/ios:ios_crash_xcuitests_module", "label": "//third_party/crashpad/crashpad/test/ios:ios_crash_xcuitests_module",
"script": "bin/run_ios_crash_xcuitests_module",
"type": "generated_script", "type": "generated_script",
}, },
"ios_components_unittests": { "ios_components_unittests": {
"args": [],
"label": "//ios/components:ios_components_unittests", "label": "//ios/components:ios_components_unittests",
"script": "bin/run_ios_components_unittests",
"type": "generated_script", "type": "generated_script",
}, },
"ios_net_unittests": { "ios_net_unittests": {
"args": [],
"label": "//ios/net:ios_net_unittests", "label": "//ios/net:ios_net_unittests",
"script": "bin/run_ios_net_unittests",
"type": "generated_script", "type": "generated_script",
}, },
"ios_remoting_unittests": { "ios_remoting_unittests": {
"args": [],
"label": "//remoting/ios:ios_remoting_unittests", "label": "//remoting/ios:ios_remoting_unittests",
"script": "bin/run_ios_remoting_unittests",
"type": "generated_script", "type": "generated_script",
}, },
"ios_showcase_egtests": { "ios_showcase_egtests": {
"args": [],
"label": "//ios/showcase:ios_showcase_egtests", "label": "//ios/showcase:ios_showcase_egtests",
"script": "bin/run_ios_showcase_egtests",
"type": "generated_script", "type": "generated_script",
}, },
"ios_showcase_eg2tests_module": { "ios_showcase_eg2tests_module": {
"args":[],
"label": "//ios/showcase:ios_showcase_eg2tests_module", "label": "//ios/showcase:ios_showcase_eg2tests_module",
"script": "bin/run_ios_showcase_eg2tests_module",
"type": "generated_script", "type": "generated_script",
}, },
"ios_testing_unittests": { "ios_testing_unittests": {
"args": [],
"label": "//ios/testing:ios_testing_unittests", "label": "//ios/testing:ios_testing_unittests",
"script": "bin/run_ios_testing_unittests",
"type": "generated_script", "type": "generated_script",
}, },
"ios_web_inttests": { "ios_web_inttests": {
"args": [],
"label": "//ios/web:ios_web_inttests", "label": "//ios/web:ios_web_inttests",
"script": "bin/run_ios_web_inttests",
"type": "generated_script", "type": "generated_script",
}, },
"ios_web_shell_eg2tests_module": { "ios_web_shell_eg2tests_module": {
"args": [],
"label": "//ios/web/shell/test:ios_web_shell_eg2tests_module", "label": "//ios/web/shell/test:ios_web_shell_eg2tests_module",
"script": "bin/run_ios_web_shell_eg2tests_module",
"type": "generated_script", "type": "generated_script",
}, },
"ios_web_shell_egtests": { "ios_web_shell_egtests": {
"args": [],
"label": "//ios/web/shell/test:ios_web_shell_egtests", "label": "//ios/web/shell/test:ios_web_shell_egtests",
"script": "bin/run_ios_web_shell_egtests",
"type": "generated_script", "type": "generated_script",
}, },
"ios_web_unittests": { "ios_web_unittests": {
"args": [],
"label": "//ios/web:ios_web_unittests", "label": "//ios/web:ios_web_unittests",
"script": "bin/run_ios_web_unittests",
"type": "generated_script", "type": "generated_script",
}, },
"ios_web_view_inttests": { "ios_web_view_inttests": {
"args": [],
"label": "//ios/web_view:ios_web_view_inttests", "label": "//ios/web_view:ios_web_view_inttests",
"script": "bin/run_ios_web_view_inttests",
"type": "generated_script", "type": "generated_script",
}, },
"ios_web_view_unittests": { "ios_web_view_unittests": {
"args": [],
"label": "//ios/web_view:ios_web_view_unittests", "label": "//ios/web_view:ios_web_view_unittests",
"script": "bin/run_ios_web_view_unittests",
"type": "generated_script", "type": "generated_script",
}, },
"ipc_tests": { "ipc_tests": {
......
...@@ -1388,12 +1388,11 @@ class MetaBuildWrapper(object): ...@@ -1388,12 +1388,11 @@ class MetaBuildWrapper(object):
cmdline = [] cmdline = []
if test_type == 'generated_script' or is_ios or is_lacros: if test_type == 'generated_script' or is_ios or is_lacros:
script = isolate_map[target].get('script', 'bin/run_{}'.format(target))
# TODO(crbug.com/816629): the 'script' in gn_isolate_map.pyl
# has a unix-style command line that won't work on win. We need to
# get rid of it.
if is_win: if is_win:
script = script.replace("bin/", "bin\\") + ".bat" default_script = 'bin\\run_{}.bat'.format(target)
else:
default_script = 'bin/run_{}'.format(target)
script = isolate_map[target].get('script', default_script)
cmdline += [script] cmdline += [script]
return cmdline, [] return cmdline, []
......
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