Commit a8be0d7f authored by Jamie Madill's avatar Jamie Madill Committed by Commit Bot

Support isolated script merges in generate_gtest.

We should be calling standard_isolated_script_merge for isolated
scripts. This will further enable using the gtest test type for
isolated scripts.

Bug: 931731
Bug: 1131231
Change-Id: Idf40e1978104b79501700944b30c581159e35341
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2443936Reviewed-by: default avatarDirk Pranke <dpranke@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813081}
parent b38faf97
......@@ -727,8 +727,9 @@ class BBJSONGenerator(object):
self.initialize_args_for_test(
result, tester_config, additional_arg_keys=['gtest_args'])
if self.is_android(tester_config) and tester_config.get('use_swarming',
True):
if self.is_android(tester_config) and tester_config.get(
'use_swarming',
True) and not test_config.get('use_isolated_scripts_api', False):
self.add_android_presentation_args(tester_config, test_name, result)
result['args'] = result.get('args', []) + ['--recover-devices']
......@@ -740,9 +741,14 @@ class BBJSONGenerator(object):
if not result.get('merge'):
# TODO(https://crbug.com/958376): Consider adding the ability to not have
# this default.
if test_config.get('use_isolated_scripts_api', False):
merge_script = 'standard_isolated_script_merge'
else:
merge_script = 'standard_gtest_merge'
result['merge'] = {
'script': '//testing/merge_scripts/standard_gtest_merge.py',
'args': [],
'script': '//testing/merge_scripts/%s.py' % merge_script,
'args': [],
}
return result
......
......@@ -892,6 +892,19 @@ COMPOSITION_SUITE_WITH_GPU_ARGS = """\
}
"""
GTEST_AS_ISOLATED_SCRIPT_SUITE = """\
{
'basic_suites': {
'foo_tests': {
'foo_test': {
'script': 'foo.py',
'use_isolated_scripts_api': True,
},
},
},
}
"""
SCRIPT_WITH_ARGS_EXCEPTIONS = """\
{
'foo_test': {
......@@ -1176,6 +1189,35 @@ VARIATION_GTEST_OUTPUT = """\
}
"""
FOO_WATERFALL_GTEST_ISOLATED_SCRIPT_OUTPUT = """\
{
"AAAAA1 AUTOGENERATED FILE DO NOT EDIT": {},
"AAAAA2 See generate_buildbot_json.py to make changes": {},
"Fake Tester": {
"gtest_tests": [
{
"merge": {
"args": [],
"script": "//testing/merge_scripts/standard_isolated_script_merge.py"
},
"script": "foo.py",
"swarming": {
"can_use_on_swarming_builders": true,
"dimension_sets": [
{
"kvm": "1"
}
]
},
"test": "foo_test",
"test_id_prefix": "ninja://chrome/test:foo_test/",
"use_isolated_scripts_api": true
}
]
}
}
"""
COMPOSITION_WATERFALL_FILTERED_OUTPUT = """\
{
"AAAAA1 AUTOGENERATED FILE DO NOT EDIT": {},
......@@ -2425,6 +2467,19 @@ class UnitTest(TestCase):
fbb.check_output_file_consistency(verbose=True)
self.assertFalse(fbb.printed_lines)
def test_gtest_as_isolated_Script(self):
fbb = FakeBBGen(self.args,
FOO_GTESTS_WATERFALL,
GTEST_AS_ISOLATED_SCRIPT_SUITE,
LUCI_MILO_CFG,
gn_isolate_map=GN_ISOLATE_MAP)
self.create_testing_buildbot_json_file(
'chromium.test.json', FOO_WATERFALL_GTEST_ISOLATED_SCRIPT_OUTPUT)
self.create_testing_buildbot_json_file(
'chromium.ci.json', FOO_WATERFALL_GTEST_ISOLATED_SCRIPT_OUTPUT)
fbb.check_output_file_consistency(verbose=True)
self.assertFalse(fbb.printed_lines)
def test_ungenerated_output_files_are_caught(self):
fbb = FakeBBGen(self.args,
COMPOSITION_GTEST_SUITE_WATERFALL,
......
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