Replace use of isolate_name with test.

The isolate_name field can be set in tests that will be put in the
isolated_scripts test type. The meaning of the field is the same as for
the test field in the gtest test type and the recipe supports either
test or isolate_name being set. Rather than have different fields that
do the same thing in different test types, this CL standardizes on using
test as the name of the field.

Bug: 1475835
Change-Id: I5a25d794bf65af74cc386ce07ebb81f8ce9a9e9e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4865091
Reviewed-by: Struan Shrimpton <[email protected]>
Reviewed-by: John Chen <[email protected]>
Commit-Queue: Garrett Beaty <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1196894}
diff --git a/testing/buildbot/generate_buildbot_json_unittest.py b/testing/buildbot/generate_buildbot_json_unittest.py
index 5795eb5..01515d38 100755
--- a/testing/buildbot/generate_buildbot_json_unittest.py
+++ b/testing/buildbot/generate_buildbot_json_unittest.py
@@ -845,6 +845,18 @@
 }
 """
 
+FOO_TEST_SUITE_WITH_ISOLATE_NAME = """\
+{
+  'basic_suites': {
+    'foo_tests': {
+      'foo_test': {
+        'isolate_name': 'bar_test',
+      },
+    },
+  },
+}
+"""
+
 FOO_TEST_SUITE_WITH_SWARMING_NAMED_CACHES = """\
 {
   'basic_suites': {
@@ -1741,7 +1753,16 @@
                     FOO_TEST_SUITE_WITH_NAME, LUCI_MILO_CFG)
     fbb.check_input_file_consistency(verbose=True)
     with self.assertRaisesRegex(generate_buildbot_json.BBGenErr,
-                                r'.*name field is set*'):
+                                r'.*\bname field is set\b.*'):
+      fbb.check_output_file_consistency(verbose=True)
+    self.assertFalse(fbb.printed_lines)
+
+  def test_isolate_name_causes_error(self):
+    fbb = FakeBBGen(self.args, FOO_GTESTS_BUILDER_MIXIN_WATERFALL,
+                    FOO_TEST_SUITE_WITH_ISOLATE_NAME, LUCI_MILO_CFG)
+    fbb.check_input_file_consistency(verbose=True)
+    with self.assertRaisesRegex(generate_buildbot_json.BBGenErr,
+                                r'.*\bisolate_name field is set\b.*'):
       fbb.check_output_file_consistency(verbose=True)
     self.assertFalse(fbb.printed_lines)