Commit aba8bad2 authored by Shenghua Zhang's avatar Shenghua Zhang Committed by Commit Bot

[Mac os] Support Mac10.9 CQ tests run on multiple dimension swarming

In the case of migrating Chrome mac 10.9 bots to 10.13, make use of
the trigger tool
//testing/trigger_scripts/trigger_multiple_dimensions_unittest.py, to
support buider chromium.mac bot 'Mac10.9 Tests' running tests on
either 10.9 or 10.13 bots in a load-balancing way.

This CL:
1) adds add_common_test_properties in generate_buildbot_json.py which
adds the tigger script logic.
2) add 'alternate_swarming_dimensions' for 'Mac10.9 Tests' tester config
in waterfalls.py
3) manually run generate_buildbot_json.py and generated the multiple
swarming dimensions configs in chromium.mac.json

Bug: 805475
Change-Id: I4aeb4b67d085c58e777c59e9685e39e3d5504598
Reviewed-on: https://chromium-review.googlesource.com/898534
Commit-Queue: Shenghua Zhang <shenghuazhang@chromium.org>
Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534879}
parent 37608a0e
This diff is collapsed.
...@@ -375,6 +375,19 @@ class BBJSONGenerator(object): ...@@ -375,6 +375,19 @@ class BBJSONGenerator(object):
self.clean_swarming_dictionary(test['swarming']) self.clean_swarming_dictionary(test['swarming'])
return test return test
def add_common_test_properties(self, test, tester_config):
if tester_config.get('use_multi_dimension_trigger_script'):
test['trigger_script'] = {
'script': '//testing/trigger_scripts/trigger_multiple_dimensions.py',
'args': [
'--multiple-trigger-configs',
json.dumps(tester_config['swarming']['dimension_sets'] +
tester_config.get('alternate_swarming_dimensions', [])),
'--multiple-dimension-script-verbose',
'True'
],
}
def generate_gtest(self, waterfall, tester_name, tester_config, test_name, def generate_gtest(self, waterfall, tester_name, tester_config, test_name,
test_config): test_config):
if not self.should_run_on_tester( if not self.should_run_on_tester(
...@@ -429,6 +442,7 @@ class BBJSONGenerator(object): ...@@ -429,6 +442,7 @@ class BBJSONGenerator(object):
result = self.update_and_cleanup_test(result, test_name, tester_name, result = self.update_and_cleanup_test(result, test_name, tester_name,
waterfall) waterfall)
self.add_common_test_properties(result, tester_config)
return result return result
def generate_isolated_script_test(self, waterfall, tester_name, tester_config, def generate_isolated_script_test(self, waterfall, tester_name, tester_config,
...@@ -442,6 +456,7 @@ class BBJSONGenerator(object): ...@@ -442,6 +456,7 @@ class BBJSONGenerator(object):
self.initialize_swarming_dictionary_for_test(result, tester_config) self.initialize_swarming_dictionary_for_test(result, tester_config)
result = self.update_and_cleanup_test(result, test_name, tester_name, result = self.update_and_cleanup_test(result, test_name, tester_name,
waterfall) waterfall)
self.add_common_test_properties(result, tester_config)
return result return result
def generate_script_test(self, waterfall, tester_name, tester_config, def generate_script_test(self, waterfall, tester_name, tester_config,
......
...@@ -48,6 +48,36 @@ FOO_GTESTS_WATERFALL = """\ ...@@ -48,6 +48,36 @@ FOO_GTESTS_WATERFALL = """\
] ]
""" """
FOO_GTESTS_MULTI_DIMENSION_WATERFALL = """\
[
{
'name': 'chromium.test',
'machines': {
'Fake Tester': {
'swarming': {
'dimension_sets': [
{
"gpu": "none",
"os": "1",
},
],
},
'use_multi_dimension_trigger_script': True,
'alternate_swarming_dimensions': [
{
"gpu": "none",
"os": "2",
},
],
'test_suites': {
'gtest_tests': 'foo_tests',
},
},
},
},
]
"""
COMPOSITION_GTEST_SUITE_WATERFALL = """\ COMPOSITION_GTEST_SUITE_WATERFALL = """\
[ [
{ {
...@@ -840,6 +870,41 @@ ANDROID_WATERFALL_OUTPUT = """\ ...@@ -840,6 +870,41 @@ ANDROID_WATERFALL_OUTPUT = """\
} }
""" """
MULTI_DIMENSION_OUTPUT = """\
{
"AAAAA1 AUTOGENERATED FILE DO NOT EDIT": {},
"AAAAA2 See generate_buildbot_json.py to make changes": {},
"Fake Tester": {
"gtest_tests": [
{
"swarming": {
"can_use_on_swarming_builders": true,
"dimension_sets": [
{
"gpu": "none",
"integrity": "high",
"os": "1"
}
],
"expiration": 120
},
"test": "foo_test",
"trigger_script": {
"args": [
"--multiple-trigger-configs",
"[{\\"gpu\\": \\"none\\", \\"os\\": \\"1\\"}, \
{\\"gpu\\": \\"none\\", \\"os\\": \\"2\\"}]",
"--multiple-dimension-script-verbose",
"True"
],
"script": "//testing/trigger_scripts/trigger_multiple_dimensions.py"
}
}
]
}
}
"""
class UnitTest(unittest.TestCase): class UnitTest(unittest.TestCase):
def test_base_generator(self): def test_base_generator(self):
# Only needed for complete code coverage. # Only needed for complete code coverage.
...@@ -856,6 +921,12 @@ class UnitTest(unittest.TestCase): ...@@ -856,6 +921,12 @@ class UnitTest(unittest.TestCase):
EMPTY_EXCEPTIONS) EMPTY_EXCEPTIONS)
fbb.check_input_file_consistency() fbb.check_input_file_consistency()
def test_good_multi_dimension_test_suites_are_ok(self):
fbb = FakeBBGen(FOO_GTESTS_MULTI_DIMENSION_WATERFALL,
FOO_TEST_SUITE,
EMPTY_EXCEPTIONS)
fbb.check_input_file_consistency()
def test_good_composition_test_suites_are_ok(self): def test_good_composition_test_suites_are_ok(self):
fbb = FakeBBGen(COMPOSITION_GTEST_SUITE_WATERFALL, fbb = FakeBBGen(COMPOSITION_GTEST_SUITE_WATERFALL,
GOOD_COMPOSITION_TEST_SUITES, GOOD_COMPOSITION_TEST_SUITES,
...@@ -1033,6 +1104,13 @@ class UnitTest(unittest.TestCase): ...@@ -1033,6 +1104,13 @@ class UnitTest(unittest.TestCase):
fbb.files['chromium.test.json'] = COMPOSITION_WATERFALL_WITH_ARGS_OUTPUT fbb.files['chromium.test.json'] = COMPOSITION_WATERFALL_WITH_ARGS_OUTPUT
fbb.check_output_file_consistency(verbose=True) fbb.check_output_file_consistency(verbose=True)
def test_multi_dimension_output(self):
fbb = FakeBBGen(FOO_GTESTS_MULTI_DIMENSION_WATERFALL,
FOO_TEST_SUITE,
EMPTY_EXCEPTIONS)
fbb.files['chromium.test.json'] = MULTI_DIMENSION_OUTPUT
fbb.check_output_file_consistency(verbose=True)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
......
...@@ -1569,6 +1569,25 @@ ...@@ -1569,6 +1569,25 @@
'isolated_scripts': 'chromium_rel_isolated_scripts', 'isolated_scripts': 'chromium_rel_isolated_scripts',
'scripts': 'chromium_scripts', 'scripts': 'chromium_scripts',
}, },
'swarming': {
'dimension_sets': [
{
"gpu": "none",
"cpu": "x86-64",
"os": "Mac-10.9",
"pool": "Chrome",
},
],
},
'use_multi_dimension_trigger_script': True,
'alternate_swarming_dimensions': [
{
"gpu": "8086:0a2e",
"cpu": "x86-64",
"os": "Mac-10.13",
"pool": "Chrome",
},
],
}, },
'Mac10.9 Tests (dbg)': { 'Mac10.9 Tests (dbg)': {
'test_suites': { 'test_suites': {
......
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