Mike Frysinger | f1ba7ad | 2022-09-12 05:42:57 -0400 | [diff] [blame] | 1 | # Copyright 2018 The ChromiumOS Authors |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | """Test gen_luci_scheduler.""" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 6 | |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 7 | from chromite.lib import config_lib |
| 8 | from chromite.lib import config_lib_unittest |
Mike Frysinger | 807d828 | 2022-04-28 22:45:17 -0400 | [diff] [blame] | 9 | from chromite.lib import cros_test_lib |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 10 | from chromite.scripts import gen_luci_scheduler |
| 11 | |
Mike Frysinger | 74a6cc8 | 2020-02-14 14:16:22 -0500 | [diff] [blame] | 12 | |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 13 | # It's reasonable for unittests to look at internals. |
| 14 | # pylint: disable=protected-access |
| 15 | |
| 16 | |
| 17 | class GenLuciSchedulerTest(cros_test_lib.MockTestCase): |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 18 | """Tests for cbuildbot_launch script.""" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 19 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 20 | def testSanityAgainstProd(self): |
| 21 | """Test we can generate a luci scheduler config with live data.""" |
| 22 | # If it runs without crashing, we pass. |
George Burgess IV | 3b98be7 | 2023-09-12 14:20:43 -0600 | [diff] [blame] | 23 | gen_luci_scheduler.genLuciSchedulerConfig(config_lib.GetConfig()) |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 24 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 25 | def testGenSchedulerJob(self): |
| 26 | """Test the job creation helper.""" |
| 27 | build_config = config_lib_unittest.MockBuildConfig().apply( |
| 28 | schedule="funky schedule" |
| 29 | ) |
| 30 | |
| 31 | expected = """ |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 32 | job { |
Mike Nichols | 9e47e84 | 2020-08-11 15:23:56 -0600 | [diff] [blame] | 33 | id: "amd64-generic-release" |
Vadim Shtayura | 6398e00 | 2021-01-11 12:02:11 -0800 | [diff] [blame] | 34 | realm: "cbb-jobs" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 35 | acl_sets: "default" |
| 36 | schedule: "funky schedule" |
| 37 | buildbucket: { |
| 38 | server: "cr-buildbucket.appspot.com" |
Vadim Shtayura | 959cb0f | 2022-02-03 12:45:58 -0800 | [diff] [blame] | 39 | bucket: "general" |
Mike Nichols | 9e47e84 | 2020-08-11 15:23:56 -0600 | [diff] [blame] | 40 | builder: "LegacyRelease" |
Mike Frysinger | 62a0245 | 2021-03-16 03:48:34 -0400 | [diff] [blame] | 41 | tags: "cbb_branch:main" |
Mike Nichols | 9e47e84 | 2020-08-11 15:23:56 -0600 | [diff] [blame] | 42 | tags: "cbb_config:amd64-generic-release" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 43 | tags: "cbb_display_label:MockLabel" |
Mike Frysinger | 62a0245 | 2021-03-16 03:48:34 -0400 | [diff] [blame] | 44 | properties: "cbb_branch:main" |
Mike Nichols | 9e47e84 | 2020-08-11 15:23:56 -0600 | [diff] [blame] | 45 | properties: "cbb_config:amd64-generic-release" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 46 | properties: "cbb_display_label:MockLabel" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 47 | properties: "cbb_extra_args:[\\"--buildbot\\"]" |
| 48 | } |
| 49 | } |
Mike Frysinger | 80de501 | 2019-08-01 14:10:53 -0400 | [diff] [blame] | 50 | """ |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 51 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 52 | result = gen_luci_scheduler.genSchedulerJob(build_config) |
| 53 | self.assertEqual(result, expected) |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 54 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 55 | def testGenSchedulerTriggerSimple(self): |
| 56 | """Test the trigger creation helper.""" |
| 57 | trigger_name = "simple" |
| 58 | repo = "url://repo" |
| 59 | refs = ["refs/path"] |
| 60 | path_regexps = ["path/regexps"] |
| 61 | builds = ["test_build"] |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 62 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 63 | expected = """ |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 64 | trigger { |
| 65 | id: "simple" |
Vadim Shtayura | 6398e00 | 2021-01-11 12:02:11 -0800 | [diff] [blame] | 66 | realm: "cbb-jobs" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 67 | acl_sets: "default" |
| 68 | schedule: "with 5m interval" |
| 69 | gitiles: { |
| 70 | repo: "url://repo" |
| 71 | refs: "refs/path" |
David Burger | cba0d27 | 2020-06-24 16:21:26 -0600 | [diff] [blame] | 72 | path_regexps: "path/regexps" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 73 | } |
| 74 | triggers: "test_build" |
| 75 | } |
Mike Frysinger | 80de501 | 2019-08-01 14:10:53 -0400 | [diff] [blame] | 76 | """ |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 77 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 78 | result = gen_luci_scheduler.genSchedulerTrigger( |
| 79 | trigger_name, repo, refs, path_regexps, builds |
| 80 | ) |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 81 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 82 | self.assertEqual(result, expected) |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 83 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 84 | def testGenSchedulerTriggerComplex(self): |
| 85 | """Test the trigger creation helper.""" |
| 86 | trigger_name = "complex" |
| 87 | repo = "url://repo" |
| 88 | refs = ["refs/path", "refs/other_path"] |
| 89 | builds = ["test_build_a", "test_build_b"] |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 90 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 91 | expected = """ |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 92 | trigger { |
| 93 | id: "complex" |
Vadim Shtayura | 6398e00 | 2021-01-11 12:02:11 -0800 | [diff] [blame] | 94 | realm: "cbb-jobs" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 95 | acl_sets: "default" |
| 96 | schedule: "with 5m interval" |
| 97 | gitiles: { |
| 98 | repo: "url://repo" |
| 99 | refs: "refs/path" |
| 100 | refs: "refs/other_path" |
| 101 | } |
| 102 | triggers: "test_build_a" |
| 103 | triggers: "test_build_b" |
| 104 | } |
Mike Frysinger | 80de501 | 2019-08-01 14:10:53 -0400 | [diff] [blame] | 105 | """ |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 106 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 107 | result = gen_luci_scheduler.genSchedulerTrigger( |
| 108 | trigger_name, repo, refs, None, builds |
| 109 | ) |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 110 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 111 | self.assertEqual(result, expected) |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 112 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 113 | def testGenSchedulerBranched(self): |
| 114 | """Test the job creation helper.""" |
| 115 | build_config = config_lib_unittest.MockBuildConfig().apply( |
| 116 | schedule_branch="mock_branch", |
| 117 | schedule="funky schedule", |
| 118 | ) |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 119 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 120 | expected = """ |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 121 | job { |
Mike Nichols | 9e47e84 | 2020-08-11 15:23:56 -0600 | [diff] [blame] | 122 | id: "mock_branch-amd64-generic-release" |
Vadim Shtayura | 6398e00 | 2021-01-11 12:02:11 -0800 | [diff] [blame] | 123 | realm: "cbb-jobs" |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 124 | acl_sets: "default" |
| 125 | schedule: "funky schedule" |
| 126 | buildbucket: { |
| 127 | server: "cr-buildbucket.appspot.com" |
Vadim Shtayura | 959cb0f | 2022-02-03 12:45:58 -0800 | [diff] [blame] | 128 | bucket: "general" |
Mike Nichols | 9e47e84 | 2020-08-11 15:23:56 -0600 | [diff] [blame] | 129 | builder: "LegacyRelease" |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 130 | tags: "cbb_branch:mock_branch" |
Mike Nichols | 9e47e84 | 2020-08-11 15:23:56 -0600 | [diff] [blame] | 131 | tags: "cbb_config:amd64-generic-release" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 132 | tags: "cbb_display_label:MockLabel" |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 133 | properties: "cbb_branch:mock_branch" |
Mike Nichols | 9e47e84 | 2020-08-11 15:23:56 -0600 | [diff] [blame] | 134 | properties: "cbb_config:amd64-generic-release" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 135 | properties: "cbb_display_label:MockLabel" |
| 136 | properties: "cbb_extra_args:[\\"--buildbot\\"]" |
| 137 | } |
| 138 | } |
Mike Frysinger | 80de501 | 2019-08-01 14:10:53 -0400 | [diff] [blame] | 139 | """ |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 140 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 141 | result = gen_luci_scheduler.genSchedulerJob(build_config) |
| 142 | self.assertEqual(result, expected) |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 143 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 144 | def testGenSchedulerWorkspaceBranch(self): |
| 145 | """Test the job creation helper.""" |
| 146 | build_config = config_lib_unittest.MockBuildConfig().apply( |
| 147 | workspace_branch="work_branch", |
| 148 | schedule="funky schedule", |
| 149 | ) |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 150 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 151 | expected = """ |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 152 | job { |
Mike Nichols | 9e47e84 | 2020-08-11 15:23:56 -0600 | [diff] [blame] | 153 | id: "amd64-generic-release" |
Vadim Shtayura | 6398e00 | 2021-01-11 12:02:11 -0800 | [diff] [blame] | 154 | realm: "cbb-jobs" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 155 | acl_sets: "default" |
| 156 | schedule: "funky schedule" |
| 157 | buildbucket: { |
| 158 | server: "cr-buildbucket.appspot.com" |
Vadim Shtayura | 959cb0f | 2022-02-03 12:45:58 -0800 | [diff] [blame] | 159 | bucket: "general" |
Mike Nichols | 9e47e84 | 2020-08-11 15:23:56 -0600 | [diff] [blame] | 160 | builder: "LegacyRelease" |
Mike Frysinger | 62a0245 | 2021-03-16 03:48:34 -0400 | [diff] [blame] | 161 | tags: "cbb_branch:main" |
Mike Nichols | 9e47e84 | 2020-08-11 15:23:56 -0600 | [diff] [blame] | 162 | tags: "cbb_config:amd64-generic-release" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 163 | tags: "cbb_display_label:MockLabel" |
| 164 | tags: "cbb_workspace_branch:work_branch" |
Mike Frysinger | 62a0245 | 2021-03-16 03:48:34 -0400 | [diff] [blame] | 165 | properties: "cbb_branch:main" |
Mike Nichols | 9e47e84 | 2020-08-11 15:23:56 -0600 | [diff] [blame] | 166 | properties: "cbb_config:amd64-generic-release" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 167 | properties: "cbb_display_label:MockLabel" |
| 168 | properties: "cbb_workspace_branch:work_branch" |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 169 | properties: "cbb_extra_args:[\\"--buildbot\\"]" |
| 170 | } |
| 171 | } |
Mike Frysinger | 80de501 | 2019-08-01 14:10:53 -0400 | [diff] [blame] | 172 | """ |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 173 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 174 | result = gen_luci_scheduler.genSchedulerJob(build_config) |
| 175 | self.assertEqual(result, expected) |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 176 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 177 | def testGenLuciSchedulerConfig(self): |
| 178 | """Test a full LUCI Scheduler config file.""" |
| 179 | site_config = config_lib.SiteConfig() |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 180 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 181 | site_config.Add( |
| 182 | "not_scheduled", |
| 183 | luci_builder="ReleaseBuilder", |
| 184 | display_label="MockLabel", |
| 185 | ) |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 186 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 187 | site_config.Add( |
| 188 | "build_prod", |
| 189 | luci_builder="ReleaseBuilder", |
| 190 | display_label="MockLabel", |
| 191 | schedule="run once in a while", |
| 192 | ) |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 193 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 194 | site_config.Add( |
| 195 | "build_tester", |
| 196 | luci_builder="TestBuilder", |
| 197 | display_label="TestLabel", |
| 198 | schedule="run daily", |
| 199 | ) |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 200 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 201 | site_config.Add( |
| 202 | "build_triggered_a", |
| 203 | luci_builder="ReleaseBuilder", |
| 204 | display_label="MockLabel", |
| 205 | schedule="triggered", |
| 206 | triggered_gitiles=[ |
| 207 | [ |
| 208 | "gitiles_url_a", |
| 209 | ["ref_a", "ref_b"], |
| 210 | ], |
| 211 | [ |
| 212 | "gitiles_url_b", |
| 213 | ["ref_c"], |
| 214 | ], |
| 215 | ], |
| 216 | ) |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 217 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 218 | site_config.Add( |
| 219 | "build_triggered_b", |
| 220 | luci_builder="ProdBuilder", |
| 221 | display_label="MockLabel", |
| 222 | schedule="triggered", |
| 223 | triggered_gitiles=[ |
| 224 | [ |
| 225 | "gitiles_url_b", |
| 226 | ["ref_c"], |
| 227 | ] |
| 228 | ], |
| 229 | ) |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 230 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 231 | expected = """# Defines buckets on luci-scheduler.appspot.com. |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 232 | # |
| 233 | # For schema of this file and documentation see ProjectConfig message in |
Mike Frysinger | 92dc649 | 2021-02-17 16:01:09 -0500 | [diff] [blame] | 234 | # https://github.com/luci/luci-go/blob/HEAD/scheduler/appengine/messages/config.proto |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 235 | |
| 236 | # Generated with chromite/scripts/gen_luci_scheduler |
| 237 | |
Don Garrett | ff45f4b | 2018-10-04 09:08:01 -0700 | [diff] [blame] | 238 | # Autodeployed with: |
Mike Nichols | b575c61 | 2021-04-09 10:04:43 -0600 | [diff] [blame] | 239 | # https://data.corp.google.com/sites/chromeos_ci_cros_ci_builds/utility/?f=board_name:in:luci-scheduler-updater |
Don Garrett | ff45f4b | 2018-10-04 09:08:01 -0700 | [diff] [blame] | 240 | |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 241 | acl_sets { |
| 242 | name: "default" |
| 243 | acls { |
| 244 | role: READER |
| 245 | granted_to: "group:googlers" |
| 246 | } |
| 247 | acls { |
| 248 | role: OWNER |
| 249 | granted_to: "group:project-chromeos-admins" |
| 250 | } |
Jason D. Clinton | a9e374a | 2018-10-18 18:41:00 -0600 | [diff] [blame] | 251 | acls { |
| 252 | role: TRIGGERER |
| 253 | granted_to: "group:mdb/chromeos-build-access" |
LaMont Jones | 48ddfd9 | 2020-09-16 13:46:41 -0600 | [diff] [blame] | 254 | } |
| 255 | acls { |
| 256 | role: TRIGGERER |
LaMont Jones | d1bb000 | 2020-09-16 09:35:10 -0600 | [diff] [blame] | 257 | granted_to: "group:project-chromeos-buildbucket-schedulers" |
Jason D. Clinton | a9e374a | 2018-10-18 18:41:00 -0600 | [diff] [blame] | 258 | } |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 259 | } |
| 260 | |
| 261 | trigger { |
| 262 | id: "trigger_0" |
Vadim Shtayura | 6398e00 | 2021-01-11 12:02:11 -0800 | [diff] [blame] | 263 | realm: "cbb-jobs" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 264 | acl_sets: "default" |
| 265 | schedule: "with 5m interval" |
| 266 | gitiles: { |
| 267 | repo: "gitiles_url_a" |
| 268 | refs: "ref_a" |
| 269 | refs: "ref_b" |
| 270 | } |
| 271 | triggers: "build_triggered_a" |
| 272 | } |
| 273 | |
| 274 | trigger { |
| 275 | id: "trigger_1" |
Vadim Shtayura | 6398e00 | 2021-01-11 12:02:11 -0800 | [diff] [blame] | 276 | realm: "cbb-jobs" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 277 | acl_sets: "default" |
| 278 | schedule: "with 5m interval" |
| 279 | gitiles: { |
| 280 | repo: "gitiles_url_b" |
| 281 | refs: "ref_c" |
| 282 | } |
| 283 | triggers: "build_triggered_a" |
| 284 | triggers: "build_triggered_b" |
| 285 | } |
| 286 | |
| 287 | job { |
| 288 | id: "build_prod" |
Vadim Shtayura | 6398e00 | 2021-01-11 12:02:11 -0800 | [diff] [blame] | 289 | realm: "cbb-jobs" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 290 | acl_sets: "default" |
| 291 | schedule: "run once in a while" |
| 292 | buildbucket: { |
| 293 | server: "cr-buildbucket.appspot.com" |
Vadim Shtayura | 959cb0f | 2022-02-03 12:45:58 -0800 | [diff] [blame] | 294 | bucket: "general" |
Mike Nichols | 9e47e84 | 2020-08-11 15:23:56 -0600 | [diff] [blame] | 295 | builder: "ReleaseBuilder" |
Mike Frysinger | 62a0245 | 2021-03-16 03:48:34 -0400 | [diff] [blame] | 296 | tags: "cbb_branch:main" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 297 | tags: "cbb_config:build_prod" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 298 | tags: "cbb_display_label:MockLabel" |
Mike Frysinger | 62a0245 | 2021-03-16 03:48:34 -0400 | [diff] [blame] | 299 | properties: "cbb_branch:main" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 300 | properties: "cbb_config:build_prod" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 301 | properties: "cbb_display_label:MockLabel" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 302 | properties: "cbb_extra_args:[\\"--buildbot\\"]" |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | job { |
| 307 | id: "build_tester" |
Vadim Shtayura | 6398e00 | 2021-01-11 12:02:11 -0800 | [diff] [blame] | 308 | realm: "cbb-jobs" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 309 | acl_sets: "default" |
| 310 | schedule: "run daily" |
| 311 | buildbucket: { |
| 312 | server: "cr-buildbucket.appspot.com" |
Vadim Shtayura | 959cb0f | 2022-02-03 12:45:58 -0800 | [diff] [blame] | 313 | bucket: "general" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 314 | builder: "TestBuilder" |
Mike Frysinger | 62a0245 | 2021-03-16 03:48:34 -0400 | [diff] [blame] | 315 | tags: "cbb_branch:main" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 316 | tags: "cbb_config:build_tester" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 317 | tags: "cbb_display_label:TestLabel" |
Mike Frysinger | 62a0245 | 2021-03-16 03:48:34 -0400 | [diff] [blame] | 318 | properties: "cbb_branch:main" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 319 | properties: "cbb_config:build_tester" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 320 | properties: "cbb_display_label:TestLabel" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 321 | properties: "cbb_extra_args:[\\"--buildbot\\"]" |
| 322 | } |
| 323 | } |
| 324 | |
| 325 | job { |
| 326 | id: "build_triggered_a" |
Vadim Shtayura | 6398e00 | 2021-01-11 12:02:11 -0800 | [diff] [blame] | 327 | realm: "cbb-jobs" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 328 | acl_sets: "default" |
| 329 | schedule: "triggered" |
| 330 | buildbucket: { |
| 331 | server: "cr-buildbucket.appspot.com" |
Vadim Shtayura | 959cb0f | 2022-02-03 12:45:58 -0800 | [diff] [blame] | 332 | bucket: "general" |
Mike Nichols | 9e47e84 | 2020-08-11 15:23:56 -0600 | [diff] [blame] | 333 | builder: "ReleaseBuilder" |
Mike Frysinger | 62a0245 | 2021-03-16 03:48:34 -0400 | [diff] [blame] | 334 | tags: "cbb_branch:main" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 335 | tags: "cbb_config:build_triggered_a" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 336 | tags: "cbb_display_label:MockLabel" |
Mike Frysinger | 62a0245 | 2021-03-16 03:48:34 -0400 | [diff] [blame] | 337 | properties: "cbb_branch:main" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 338 | properties: "cbb_config:build_triggered_a" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 339 | properties: "cbb_display_label:MockLabel" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 340 | properties: "cbb_extra_args:[\\"--buildbot\\"]" |
| 341 | } |
| 342 | } |
| 343 | |
| 344 | job { |
| 345 | id: "build_triggered_b" |
Vadim Shtayura | 6398e00 | 2021-01-11 12:02:11 -0800 | [diff] [blame] | 346 | realm: "cbb-jobs" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 347 | acl_sets: "default" |
| 348 | schedule: "triggered" |
| 349 | buildbucket: { |
| 350 | server: "cr-buildbucket.appspot.com" |
Vadim Shtayura | 959cb0f | 2022-02-03 12:45:58 -0800 | [diff] [blame] | 351 | bucket: "general" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 352 | builder: "ProdBuilder" |
Mike Frysinger | 62a0245 | 2021-03-16 03:48:34 -0400 | [diff] [blame] | 353 | tags: "cbb_branch:main" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 354 | tags: "cbb_config:build_triggered_b" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 355 | tags: "cbb_display_label:MockLabel" |
Mike Frysinger | 62a0245 | 2021-03-16 03:48:34 -0400 | [diff] [blame] | 356 | properties: "cbb_branch:main" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 357 | properties: "cbb_config:build_triggered_b" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 358 | properties: "cbb_display_label:MockLabel" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 359 | properties: "cbb_extra_args:[\\"--buildbot\\"]" |
| 360 | } |
| 361 | } |
Mike Frysinger | 80de501 | 2019-08-01 14:10:53 -0400 | [diff] [blame] | 362 | """ |
George Burgess IV | 3b98be7 | 2023-09-12 14:20:43 -0600 | [diff] [blame] | 363 | result = gen_luci_scheduler.genLuciSchedulerConfig(site_config) |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 364 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 365 | self.assertEqual(result, expected) |