diff options
author | dpranke <dpranke@chromium.org> | 2016-02-04 18:43:59 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-05 02:45:07 +0000 |
commit | fe0d35e9672feaaa8c19612dcc33ede70738c0e0 (patch) | |
tree | d435356c23617b6a63e122f8a7f1398740b5ec95 | |
parent | 9168e073e6b25bb5fac550ff92fb5d76f1452d4d (diff) | |
download | chromium_src-fe0d35e9672feaaa8c19612dcc33ede70738c0e0.zip chromium_src-fe0d35e9672feaaa8c19612dcc33ede70738c0e0.tar.gz chromium_src-fe0d35e9672feaaa8c19612dcc33ede70738c0e0.tar.bz2 |
Add isolate for content_browsertests with --site-per-process.
(Patch from issue 1572633002 at patchset 200001 (http://crrev.com/1572633002#ps200001))
BUG=579704
R=nasko@chromium.org, maruel@chromium.org, phajdan.jr@chromium.org
Review URL: https://codereview.chromium.org/1620513002
Cr-Commit-Position: refs/heads/master@{#373727}
-rw-r--r-- | content/content_site_isolation_browsertests.isolate | 21 | ||||
-rw-r--r-- | content/content_tests.gypi | 11 | ||||
-rw-r--r-- | content/test/BUILD.gn | 19 | ||||
-rw-r--r-- | testing/buildbot/chromium.linux.json | 9 | ||||
-rw-r--r-- | testing/buildbot/gn_isolate_map.pyl | 49 | ||||
-rwxr-xr-x | tools/mb/mb.py | 33 |
6 files changed, 121 insertions, 21 deletions
diff --git a/content/content_site_isolation_browsertests.isolate b/content/content_site_isolation_browsertests.isolate new file mode 100644 index 0000000..9fcfd9a --- /dev/null +++ b/content/content_site_isolation_browsertests.isolate @@ -0,0 +1,21 @@ +# Copyright 2015 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. +{ + 'includes': [ + 'content_browsertests.isolate', + ], + 'conditions': [ + ['OS=="linux"', { + 'variables': { + 'command': [ + '../testing/test_env.py', + '<(PRODUCT_DIR)/content_browsertests<(EXECUTABLE_SUFFIX)', + '--test-launcher-bot-mode', + '--site-per-process', + '--test-launcher-filter-file=../testing/buildbot/filters/site-per-process.content_browsertests.filter', + ], + }, + }], + ], +} diff --git a/content/content_tests.gypi b/content/content_tests.gypi index 601c483..0d95ba6 100644 --- a/content/content_tests.gypi +++ b/content/content_tests.gypi @@ -1022,6 +1022,17 @@ ['test_isolation_mode != "noop"', { 'targets': [ { + # GN: //content/test:content_site_isolation_browsertests_run + 'target_name': 'content_site_isolation_browsertests_run', + 'type': 'none', + 'dependencies': [ + 'content_browsertests_run', + ], + 'sources': [ + 'content_site_isolation_browsertests.isolate', + ], + }, + { 'target_name': 'content_browsertests_run', 'type': 'none', 'dependencies': [ diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index fc8a415..5317f6c 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn @@ -339,6 +339,25 @@ if (is_android) { } } +# TODO(GYP): Delete this after we've converted everything to GN. +# The _run targets exist only for compatibility w/ GYP. +group("content_site_isolation_browsertests_run") { + testonly = true + deps = [ + ":content_browsertests", + ] +} + +group("content_site_isolation_browsertests") { + testonly = true + data = [ + "//testing/buildbot/filters/site-per-process.content_browsertests.filter", + ] + data_deps = [ + ":content_browsertests", + ] +} + test("content_browsertests") { sources = rebase_path(content_tests_gypi_values.content_browsertests_sources, ".", diff --git a/testing/buildbot/chromium.linux.json b/testing/buildbot/chromium.linux.json index 378248c..48bcf01 100644 --- a/testing/buildbot/chromium.linux.json +++ b/testing/buildbot/chromium.linux.json @@ -641,6 +641,15 @@ "test": "content_browsertests" }, { + "override_compile_targets": [ + "content_site_isolation_browsertests" + ], + "swarming": { + "can_use_on_swarming_builders": true + }, + "test": "content_site_isolation_browsertests" + }, + { "swarming": { "can_use_on_swarming_builders": true }, diff --git a/testing/buildbot/gn_isolate_map.pyl b/testing/buildbot/gn_isolate_map.pyl index 3d6d327..275ab74 100644 --- a/testing/buildbot/gn_isolate_map.pyl +++ b/testing/buildbot/gn_isolate_map.pyl @@ -11,26 +11,54 @@ # much always the same as the Ninja target name, since GYP target names are not # hierarchical). # -# The 'type' field is used to determine what the command line for the test +# The "label" field specifies the matching GN label for the given ninja +# target. +# +# The "type" field is used to determine what the command line for the test # needs to be; valid values are: # -# "windowed_test_launcher" -# : the test is a gtest-based test that uses the 'brave-new-test-launcher' -# from //base/test:test_support and needs to run under Xvfb if run on -# an X11-based platform (use_x11=true). +# "windowed_test_launcher" +# : the test is a gtest-based test that uses the "brave-new-test-launcher" +# from //base/test:test_support and needs to run under Xvfb if run on +# an X11-based platform (use_x11=true). # "console_test_launcher" -# : the test is a gtest-based test that uses the 'brave-new-test-launcher' +# : the test is a gtest-based test that uses the "brave-new-test-launcher" # from //base/test:test_support but does not need Xvfb. # "gpu_browser_test" # : the test is a subset of the browser_tests that will be run against # a real GPU. # "raw" # : the test is a standalone executable; it may take an optional list of -# command line arguments in the 'args' field, but otherwise needs no +# command line arguments in the "args" field, but otherwise needs no # extra files or special handling. +# "script" +# : the test is a python script; the path to the script is specified in +# the "script" field. # "unknown" # : (the default), which indicates that we don't know what the command line # needs to be (this is a fatal error). +# +# The optional "executable" field can be used to override the name +# of the binary to run. If the field is not specified, the binary +# name will be assumed to be the same as the ninja build target name. +# On Windows, ".exe" will be automatically appended if need be, so +# the executable name (and target name) should not contain an ".exe". +# +# The optional "args" field can be used to 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 +# "type" == "console_test_launcher" or "type" == "windowed_test_launcher" +# to indicate that even though the command line +# to use follows the test_launcher patterns, the actual GN label refers +# to a different type of thing (usually a "group") and so MB can find +# the generated runtime files in the right place. This is used, for +# example, in content_site_isolation_browsertests . +# +# The optional "script" field is used when "type" == "script", and +# specifies the GN path to the corresponding python file, e.g. +# "//testing/scripts/foo.py". { "accessibility_unittests": { @@ -175,6 +203,13 @@ "type": "raw", "args": [], }, + "content_site_isolation_browsertests": { + "label": "//content/test:content_site_isolation_browsertests", + "label_type": "group", + "type": "windowed_test_launcher", + "executable": "content_browsertests", + "args": ["--site-per-process", "--test-launcher-filter-file=../../testing/buildbot/filters/site-per-process.content_browsertests.filter"], + }, "content_unittests": { "label": "//content/test:content_unittests", "type": "windowed_test_launcher", diff --git a/tools/mb/mb.py b/tools/mb/mb.py index 950b7c6..5eace7c 100755 --- a/tools/mb/mb.py +++ b/tools/mb/mb.py @@ -545,7 +545,8 @@ class MetaBuildWrapper(object): 'obj/%s.stamp' % label.replace(':', '/')] elif gn_isolate_map[target]['type'] == 'gpu_browser_test': runtime_deps_targets = ['browser_tests'] - elif gn_isolate_map[target]['type'] == 'script': + elif (gn_isolate_map[target]['type'] == 'script' or + gn_isolate_map[target].get('label_type') == 'group'): # For script targets, the build target is usually a group, # for which gn generates the runtime_deps next to the stamp file # for the label, which lives under the obj/ directory. @@ -699,10 +700,12 @@ class MetaBuildWrapper(object): msan = 'is_msan=true' in vals['gn_args'] tsan = 'is_tsan=true' in vals['gn_args'] - executable_suffix = '.exe' if self.platform == 'win32' else '' - target_name = self.GNTargetName(target) test_type = gn_isolate_map[target_name]['type'] + + executable = gn_isolate_map[target_name].get('executable', target_name) + executable_suffix = '.exe' if self.platform == 'win32' else '' + cmdline = [] extra_files = [] @@ -717,14 +720,14 @@ class MetaBuildWrapper(object): '../../testing/xvfb.py', ] cmdline = [ - '../../testing/xvfb.py', - '.', - './' + str(target), - '--brave-new-test-launcher', - '--test-launcher-bot-mode', - '--asan=%d' % asan, - '--msan=%d' % msan, - '--tsan=%d' % tsan, + '../../testing/xvfb.py', + '.', + './' + str(executable) + executable_suffix, + '--brave-new-test-launcher', + '--test-launcher-bot-mode', + '--asan=%d' % asan, + '--msan=%d' % msan, + '--tsan=%d' % tsan, ] elif test_type in ('windowed_test_launcher', 'console_test_launcher'): extra_files = [ @@ -732,7 +735,7 @@ class MetaBuildWrapper(object): ] cmdline = [ '../../testing/test_env.py', - './' + str(target) + executable_suffix, + './' + str(executable) + executable_suffix, '--brave-new-test-launcher', '--test-launcher-bot-mode', '--asan=%d' % asan, @@ -759,17 +762,19 @@ class MetaBuildWrapper(object): cmdline = [ '../../testing/test_env.py', '../../' + self.ToSrcRelPath(gn_isolate_map[target]['script']) - ] + gn_isolate_map[target].get('args', []) + ] elif test_type in ('raw'): extra_files = [] cmdline = [ './' + str(target) + executable_suffix, - ] + gn_isolate_map[target].get('args') + ] else: self.WriteFailureAndRaise('No command line for %s found (test type %s).' % (target, test_type), output_path=None) + cmdline += gn_isolate_map[target].get('args', []) + return cmdline, extra_files def ToAbsPath(self, build_path, *comps): |