Commit c9e01c60 authored by Rakib M. Hasan's avatar Rakib M. Hasan Committed by Commit Bot

Fix naming issue for matrix compound test suites that have the 'test' key

If the 'test' key is in the definition for a basic test suite, then
that value overrides the mixed compound test suites name.
The name for the suite should be the test suites name plus the
identifier field set in a variants list entry.

Bug: 1041619
Bug: 1109967
Change-Id: I8a44b23d2511d2a5e85c0d06e3047c1d50abf011
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2318305
Commit-Queue: Rakib Hasan <rmhasan@google.com>
Reviewed-by: default avatarGarrett Beaty <gbeaty@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792036}
parent 440e8d7f
......@@ -686,7 +686,7 @@ class BBJSONGenerator(object):
'--bucket',
bucket,
'--test-name',
test_name
result.get('name', test_name)
],
'script': '//build/android/pylib/results/presentation/'
'test_results_presentation.py',
......@@ -722,7 +722,8 @@ class BBJSONGenerator(object):
return None
result = copy.deepcopy(test_config)
if 'test' in result:
result['name'] = test_name
if 'name' not in result:
result['name'] = test_name
else:
result['test'] = test_name
self.initialize_swarming_dictionary_for_test(result, tester_config)
......
......@@ -5383,6 +5383,27 @@ MATRIX_COMPOUND_VARIANTS_REF = """\
}
"""
MATRIX_COMPOUND_TEST_WITH_TEST_KEY = """\
{
'basic_suites': {
'foo_tests': {
'swarming_test': {
'test': 'foo_test_apk'
},
}
},
'matrix_compound_suites': {
'matrix_tests': {
'foo_tests': {
'variants': [
'a_variant',
],
},
},
},
}
"""
MATRIX_COMPOUND_MIXED_VARIANTS_REF = """\
{
'basic_suites': {
......@@ -5458,6 +5479,34 @@ MATRIX_COMPOUND_EMPTY_OUTPUT = """\
}
"""
MATRIX_COMPOUND_TEST_SUITE_WITH_TEST_KEY_DICT = """\
{
"AAAAA1 AUTOGENERATED FILE DO NOT EDIT": {},
"AAAAA2 See generate_buildbot_json.py to make changes": {},
"Fake Tester": {
"gtest_tests": [
{
"args": [
"--platform",
"device",
"--version",
"1"
],
"merge": {
"args": [],
"script": "//testing/merge_scripts/standard_gtest_merge.py"
},
"name": "swarming_test_a_variant",
"swarming": {
"can_use_on_swarming_builders": true
},
"test": "foo_test_apk"
}
]
}
}
"""
MATRIX_TARGET_DICT_MERGE_OUTPUT_ARGS = """\
{
"AAAAA1 AUTOGENERATED FILE DO NOT EDIT": {},
......@@ -5807,6 +5856,22 @@ class MatrixCompositionTests(TestCase):
fbb.check_output_file_consistency(verbose=True)
self.assertFalse(fbb.printed_lines)
def test_variant_test_suite_with_test_key(self):
"""
Test targets in matrix compound test suites with variants
"""
fbb = FakeBBGen(self.args,
MATRIX_GTEST_SUITE_WATERFALL,
MATRIX_COMPOUND_TEST_WITH_TEST_KEY,
LUCI_MILO_CFG,
variants=VARIANTS_FILE)
self.create_testing_buildbot_json_file(
'chromium.test.json', MATRIX_COMPOUND_TEST_SUITE_WITH_TEST_KEY_DICT)
self.create_testing_buildbot_json_file(
'chromium.ci.json', MATRIX_COMPOUND_TEST_SUITE_WITH_TEST_KEY_DICT)
fbb.check_output_file_consistency(verbose=True)
self.assertFalse(fbb.printed_lines)
def test_variants_pyl_ref(self):
"""Test targets with variants string ref"""
fbb = FakeBBGen(self.args,
......
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