Ensure all swarming tests on Macs specify `os` and `cpu`.
This CL ensures that every test run under swarming on a Mac bot
will explicitly set the `os` and `cpu` swarming dimensions. This
will keep us from accidentally scheduling binaries from a Mac x64
build to run on an ARM bot, or vice versa.
Also, this helps make the test configs a bit more explicit and
will move us closer to removing the build-side reliance on
TARGET_PLATFORM.
The CL updates all the existing entries that were missing and
modifies //testing/buildbot/generate_buildbot_json.py to check
to make sure they are present.
There should be no actual behavior changes from this CL.
Bug: 1203436, 1188847
Change-Id: Ie9d51544fe1f3767b67a7f154be74d3f3e8feb4c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2855105
Commit-Queue: Dirk Pranke <[email protected]>
Reviewed-by: Garrett Beaty <[email protected]>
Cr-Commit-Position: refs/heads/master@{#876914}
diff --git a/testing/buildbot/generate_buildbot_json.py b/testing/buildbot/generate_buildbot_json.py
index e08711e..3b4ddafb 100755
--- a/testing/buildbot/generate_buildbot_json.py
+++ b/testing/buildbot/generate_buildbot_json.py
@@ -1894,7 +1894,8 @@
# by this script already.
self.resolve_configuration_files()
ungenerated_files = set()
- for filename, expected_contents in self.generate_outputs().items():
+ outputs = self.generate_outputs()
+ for filename, expected_contents in outputs.items():
expected = self.jsonify(expected_contents)
file_path = filename + '.json'
current = self.read_file(self.pyl_file_path(file_path))
@@ -1916,6 +1917,31 @@
'autogenerated by generate_buildbot_json.py: ' +
', '.join([filename + '.json' for filename in ungenerated_files]))
+ for builder_group, builders in outputs.items():
+ for builder, step_types in builders.items():
+ for step_data in step_types.get('gtest_tests', []):
+ step_name = step_data.get('name', step_data['test'])
+ self._check_swarming_config(builder_group, builder, step_name,
+ step_data)
+ for step_data in step_types.get('isolated_scripts', []):
+ step_name = step_data.get('name', step_data['isolate_name'])
+ self._check_swarming_config(builder_group, builder, step_name,
+ step_data)
+
+ def _check_swarming_config(self, filename, builder, step_name, step_data):
+ # TODO(crbug.com/1203436): Ensure all swarming tests specify os and cpu, not
+ # just mac tests.
+ if ('mac' in builder.lower()
+ and step_data['swarming']['can_use_on_swarming_builders']):
+ dimension_sets = step_data['swarming'].get('dimension_sets')
+ if not dimension_sets:
+ raise BBGenErr('%s: %s / %s : os and cpu must be specified for mac '
+ 'swarmed tests' % (filename, builder, step_name))
+ for s in dimension_sets:
+ if not s.get('os') or not s.get('cpu'):
+ raise BBGenErr('%s: %s / %s : os and cpu must be specified for mac '
+ 'swarmed tests' % (filename, builder, step_name))
+
def check_consistency(self, verbose=False):
self.check_input_file_consistency(verbose) # pragma: no cover
self.check_output_file_consistency(verbose) # pragma: no cover