Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 1 | # -*- coding: utf-8 -*- |
| 2 | # Copyright 2018 The Chromium OS Authors. All rights reserved. |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | |
| 6 | """Test gen_luci_scheduler.""" |
| 7 | from __future__ import print_function |
| 8 | |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 9 | from chromite.config import chromeos_config |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 10 | from chromite.lib import cros_test_lib |
| 11 | from chromite.lib import config_lib |
| 12 | from chromite.lib import config_lib_unittest |
| 13 | from chromite.scripts import gen_luci_scheduler |
| 14 | |
| 15 | # It's reasonable for unittests to look at internals. |
| 16 | # pylint: disable=protected-access |
| 17 | |
| 18 | |
| 19 | class GenLuciSchedulerTest(cros_test_lib.MockTestCase): |
| 20 | """Tests for cbuildbot_launch script.""" |
| 21 | def testSanityAgainstProd(self): |
| 22 | """Test we can generate a luci scheduler config with live data.""" |
| 23 | # If it runs without crashing, we pass. |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 24 | gen_luci_scheduler.genLuciSchedulerConfig( |
| 25 | config_lib.GetConfig(), chromeos_config.BranchScheduleConfig()) |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 26 | |
| 27 | def testGenSchedulerJob(self): |
| 28 | """Test the job creation helper.""" |
| 29 | build_config = config_lib_unittest.MockBuildConfig().apply( |
| 30 | schedule='funky schedule' |
| 31 | ) |
| 32 | |
Mike Frysinger | 80de501 | 2019-08-01 14:10:53 -0400 | [diff] [blame] | 33 | expected = """ |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 34 | job { |
| 35 | id: "amd64-generic-paladin" |
| 36 | acl_sets: "default" |
| 37 | schedule: "funky schedule" |
| 38 | buildbucket: { |
| 39 | server: "cr-buildbucket.appspot.com" |
| 40 | bucket: "luci.chromeos.general" |
| 41 | builder: "Prod" |
| 42 | tags: "cbb_branch:master" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 43 | tags: "cbb_config:amd64-generic-paladin" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 44 | tags: "cbb_display_label:MockLabel" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 45 | properties: "cbb_branch:master" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 46 | properties: "cbb_config:amd64-generic-paladin" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 47 | properties: "cbb_display_label:MockLabel" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 48 | properties: "cbb_extra_args:[\\"--buildbot\\"]" |
| 49 | } |
| 50 | } |
Mike Frysinger | 80de501 | 2019-08-01 14:10:53 -0400 | [diff] [blame] | 51 | """ |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 52 | |
| 53 | result = gen_luci_scheduler.genSchedulerJob(build_config) |
| 54 | self.assertEqual(result, expected) |
| 55 | |
| 56 | def testGenSchedulerTriggerSimple(self): |
| 57 | """Test the trigger creation helper.""" |
| 58 | trigger_name = 'simple' |
| 59 | repo = 'url://repo' |
| 60 | refs = ['refs/path'] |
| 61 | builds = ['test_build'] |
| 62 | |
Mike Frysinger | 80de501 | 2019-08-01 14:10:53 -0400 | [diff] [blame] | 63 | expected = """ |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 64 | trigger { |
| 65 | id: "simple" |
| 66 | acl_sets: "default" |
| 67 | schedule: "with 5m interval" |
| 68 | gitiles: { |
| 69 | repo: "url://repo" |
| 70 | refs: "refs/path" |
| 71 | } |
| 72 | triggers: "test_build" |
| 73 | } |
Mike Frysinger | 80de501 | 2019-08-01 14:10:53 -0400 | [diff] [blame] | 74 | """ |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 75 | |
| 76 | result = gen_luci_scheduler.genSchedulerTrigger( |
| 77 | trigger_name, repo, refs, builds) |
| 78 | |
| 79 | self.assertEqual(result, expected) |
| 80 | |
| 81 | def testGenSchedulerTriggerComplex(self): |
| 82 | """Test the trigger creation helper.""" |
| 83 | trigger_name = 'complex' |
| 84 | repo = 'url://repo' |
| 85 | refs = ['refs/path', 'refs/other_path'] |
| 86 | builds = ['test_build_a', 'test_build_b'] |
| 87 | |
Mike Frysinger | 80de501 | 2019-08-01 14:10:53 -0400 | [diff] [blame] | 88 | expected = """ |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 89 | trigger { |
| 90 | id: "complex" |
| 91 | acl_sets: "default" |
| 92 | schedule: "with 5m interval" |
| 93 | gitiles: { |
| 94 | repo: "url://repo" |
| 95 | refs: "refs/path" |
| 96 | refs: "refs/other_path" |
| 97 | } |
| 98 | triggers: "test_build_a" |
| 99 | triggers: "test_build_b" |
| 100 | } |
Mike Frysinger | 80de501 | 2019-08-01 14:10:53 -0400 | [diff] [blame] | 101 | """ |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 102 | |
| 103 | result = gen_luci_scheduler.genSchedulerTrigger( |
| 104 | trigger_name, repo, refs, builds) |
| 105 | |
| 106 | self.assertEqual(result, expected) |
| 107 | |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 108 | |
| 109 | def testGenSchedulerBranched(self): |
| 110 | """Test the job creation helper.""" |
| 111 | build_config = config_lib_unittest.MockBuildConfig().apply( |
| 112 | schedule_branch='mock_branch', |
| 113 | schedule='funky schedule', |
| 114 | ) |
| 115 | |
Mike Frysinger | 80de501 | 2019-08-01 14:10:53 -0400 | [diff] [blame] | 116 | expected = """ |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 117 | job { |
| 118 | id: "mock_branch-amd64-generic-paladin" |
| 119 | acl_sets: "default" |
| 120 | schedule: "funky schedule" |
| 121 | buildbucket: { |
| 122 | server: "cr-buildbucket.appspot.com" |
| 123 | bucket: "luci.chromeos.general" |
| 124 | builder: "Prod" |
| 125 | tags: "cbb_branch:mock_branch" |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 126 | tags: "cbb_config:amd64-generic-paladin" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 127 | tags: "cbb_display_label:MockLabel" |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 128 | properties: "cbb_branch:mock_branch" |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 129 | properties: "cbb_config:amd64-generic-paladin" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 130 | properties: "cbb_display_label:MockLabel" |
| 131 | properties: "cbb_extra_args:[\\"--buildbot\\"]" |
| 132 | } |
| 133 | } |
Mike Frysinger | 80de501 | 2019-08-01 14:10:53 -0400 | [diff] [blame] | 134 | """ |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 135 | |
| 136 | result = gen_luci_scheduler.genSchedulerJob(build_config) |
| 137 | self.assertEqual(result, expected) |
| 138 | |
| 139 | def testGenSchedulerWorkspaceBranch(self): |
| 140 | """Test the job creation helper.""" |
| 141 | build_config = config_lib_unittest.MockBuildConfig().apply( |
| 142 | workspace_branch='work_branch', |
| 143 | schedule='funky schedule', |
| 144 | ) |
| 145 | |
Mike Frysinger | 80de501 | 2019-08-01 14:10:53 -0400 | [diff] [blame] | 146 | expected = """ |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 147 | job { |
| 148 | id: "amd64-generic-paladin" |
| 149 | acl_sets: "default" |
| 150 | schedule: "funky schedule" |
| 151 | buildbucket: { |
| 152 | server: "cr-buildbucket.appspot.com" |
| 153 | bucket: "luci.chromeos.general" |
| 154 | builder: "Prod" |
| 155 | tags: "cbb_branch:master" |
| 156 | tags: "cbb_config:amd64-generic-paladin" |
| 157 | tags: "cbb_display_label:MockLabel" |
| 158 | tags: "cbb_workspace_branch:work_branch" |
| 159 | properties: "cbb_branch:master" |
| 160 | properties: "cbb_config:amd64-generic-paladin" |
| 161 | properties: "cbb_display_label:MockLabel" |
| 162 | properties: "cbb_workspace_branch:work_branch" |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 163 | properties: "cbb_extra_args:[\\"--buildbot\\"]" |
| 164 | } |
| 165 | } |
Mike Frysinger | 80de501 | 2019-08-01 14:10:53 -0400 | [diff] [blame] | 166 | """ |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 167 | |
| 168 | result = gen_luci_scheduler.genSchedulerJob(build_config) |
| 169 | self.assertEqual(result, expected) |
| 170 | |
Yoshisato Yanagisawa | 16285b4 | 2018-09-19 14:00:58 +0900 | [diff] [blame] | 171 | def testGenSchedulerGomaClientType(self): |
| 172 | """Test the job creation helper.""" |
| 173 | build_config = config_lib_unittest.MockBuildConfig().apply( |
| 174 | goma_client_type='client_type', |
| 175 | schedule='funky schedule', |
| 176 | ) |
| 177 | |
Mike Frysinger | 80de501 | 2019-08-01 14:10:53 -0400 | [diff] [blame] | 178 | expected = """ |
Yoshisato Yanagisawa | 16285b4 | 2018-09-19 14:00:58 +0900 | [diff] [blame] | 179 | job { |
| 180 | id: "amd64-generic-paladin" |
| 181 | acl_sets: "default" |
| 182 | schedule: "funky schedule" |
| 183 | buildbucket: { |
| 184 | server: "cr-buildbucket.appspot.com" |
| 185 | bucket: "luci.chromeos.general" |
| 186 | builder: "Prod" |
| 187 | tags: "cbb_branch:master" |
| 188 | tags: "cbb_config:amd64-generic-paladin" |
| 189 | tags: "cbb_display_label:MockLabel" |
| 190 | tags: "cbb_goma_client_type:client_type" |
| 191 | properties: "cbb_branch:master" |
| 192 | properties: "cbb_config:amd64-generic-paladin" |
| 193 | properties: "cbb_display_label:MockLabel" |
| 194 | properties: "cbb_goma_client_type:client_type" |
| 195 | properties: "cbb_extra_args:[\\"--buildbot\\"]" |
| 196 | } |
| 197 | } |
Mike Frysinger | 80de501 | 2019-08-01 14:10:53 -0400 | [diff] [blame] | 198 | """ |
Yoshisato Yanagisawa | 16285b4 | 2018-09-19 14:00:58 +0900 | [diff] [blame] | 199 | |
| 200 | result = gen_luci_scheduler.genSchedulerJob(build_config) |
| 201 | self.assertEqual(result, expected) |
| 202 | |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 203 | def testGenLuciSchedulerConfig(self): |
| 204 | """Test a full LUCI Scheduler config file.""" |
| 205 | site_config = config_lib.SiteConfig() |
| 206 | |
| 207 | site_config.Add( |
| 208 | 'not_scheduled', |
| 209 | luci_builder='ProdBuilder', |
| 210 | display_label='MockLabel', |
| 211 | ) |
| 212 | |
| 213 | site_config.Add( |
| 214 | 'build_prod', |
| 215 | luci_builder='ProdBuilder', |
| 216 | display_label='MockLabel', |
| 217 | schedule='run once in a while', |
| 218 | ) |
| 219 | |
| 220 | site_config.Add( |
| 221 | 'build_tester', |
| 222 | luci_builder='TestBuilder', |
| 223 | display_label='TestLabel', |
| 224 | schedule='run daily', |
| 225 | ) |
| 226 | |
| 227 | site_config.Add( |
| 228 | 'build_triggered_a', |
| 229 | luci_builder='ProdBuilder', |
| 230 | display_label='MockLabel', |
| 231 | schedule='triggered', |
| 232 | triggered_gitiles=[[ |
| 233 | 'gitiles_url_a', |
| 234 | ['ref_a', 'ref_b'], |
| 235 | ], [ |
| 236 | 'gitiles_url_b', |
| 237 | ['ref_c'], |
| 238 | ]], |
| 239 | ) |
| 240 | |
| 241 | site_config.Add( |
| 242 | 'build_triggered_b', |
| 243 | luci_builder='ProdBuilder', |
| 244 | display_label='MockLabel', |
| 245 | schedule='triggered', |
| 246 | triggered_gitiles=[[ |
| 247 | 'gitiles_url_b', |
| 248 | ['ref_c'], |
| 249 | ]], |
| 250 | ) |
| 251 | |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 252 | default_config = config_lib.GetConfig().GetDefault() |
| 253 | |
| 254 | branch_configs = [ |
| 255 | default_config.derive( |
| 256 | name='branch_tester', |
| 257 | luci_builder='TestBuilder', |
| 258 | display_label='TestLabel', |
| 259 | schedule='run daily', |
| 260 | schedule_branch='test-branch', |
| 261 | ), |
Don Garrett | 9a0d90c | 2018-10-30 12:47:14 -0700 | [diff] [blame] | 262 | default_config.derive( |
| 263 | name='branch_tester_triggered', |
| 264 | luci_builder='TestBuilder', |
| 265 | display_label='TestLabel', |
| 266 | schedule='run daily', |
| 267 | schedule_branch='test-branch', |
| 268 | triggered_gitiles=[[ |
| 269 | 'gitiles_url_a', |
| 270 | ['ref_a', 'ref_b'], |
| 271 | ]], |
| 272 | ), |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 273 | ] |
| 274 | |
Mike Frysinger | 80de501 | 2019-08-01 14:10:53 -0400 | [diff] [blame] | 275 | expected = """# Defines buckets on luci-scheduler.appspot.com. |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 276 | # |
| 277 | # For schema of this file and documentation see ProjectConfig message in |
| 278 | # https://github.com/luci/luci-go/blob/master/scheduler/appengine/messages/config.proto |
| 279 | |
| 280 | # Generated with chromite/scripts/gen_luci_scheduler |
| 281 | |
Don Garrett | ff45f4b | 2018-10-04 09:08:01 -0700 | [diff] [blame] | 282 | # Autodeployed with: |
| 283 | # http://cros-goldeneye/chromeos/legoland/builderHistory?buildConfig=luci-scheduler-updater |
| 284 | |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 285 | acl_sets { |
| 286 | name: "default" |
| 287 | acls { |
| 288 | role: READER |
| 289 | granted_to: "group:googlers" |
| 290 | } |
| 291 | acls { |
| 292 | role: OWNER |
| 293 | granted_to: "group:project-chromeos-admins" |
| 294 | } |
Jason D. Clinton | a9e374a | 2018-10-18 18:41:00 -0600 | [diff] [blame] | 295 | acls { |
| 296 | role: TRIGGERER |
| 297 | granted_to: "group:mdb/chromeos-build-access" |
| 298 | } |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 299 | } |
| 300 | |
| 301 | trigger { |
| 302 | id: "trigger_0" |
| 303 | acl_sets: "default" |
| 304 | schedule: "with 5m interval" |
| 305 | gitiles: { |
| 306 | repo: "gitiles_url_a" |
| 307 | refs: "ref_a" |
| 308 | refs: "ref_b" |
| 309 | } |
| 310 | triggers: "build_triggered_a" |
Don Garrett | 9a0d90c | 2018-10-30 12:47:14 -0700 | [diff] [blame] | 311 | triggers: "test-branch-branch_tester_triggered" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 312 | } |
| 313 | |
| 314 | trigger { |
| 315 | id: "trigger_1" |
| 316 | acl_sets: "default" |
| 317 | schedule: "with 5m interval" |
| 318 | gitiles: { |
| 319 | repo: "gitiles_url_b" |
| 320 | refs: "ref_c" |
| 321 | } |
| 322 | triggers: "build_triggered_a" |
| 323 | triggers: "build_triggered_b" |
| 324 | } |
| 325 | |
| 326 | job { |
| 327 | id: "build_prod" |
| 328 | acl_sets: "default" |
| 329 | schedule: "run once in a while" |
| 330 | buildbucket: { |
| 331 | server: "cr-buildbucket.appspot.com" |
| 332 | bucket: "luci.chromeos.general" |
| 333 | builder: "ProdBuilder" |
| 334 | tags: "cbb_branch:master" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 335 | tags: "cbb_config:build_prod" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 336 | tags: "cbb_display_label:MockLabel" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 337 | properties: "cbb_branch:master" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 338 | properties: "cbb_config:build_prod" |
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_tester" |
| 346 | acl_sets: "default" |
| 347 | schedule: "run daily" |
| 348 | buildbucket: { |
| 349 | server: "cr-buildbucket.appspot.com" |
| 350 | bucket: "luci.chromeos.general" |
| 351 | builder: "TestBuilder" |
| 352 | tags: "cbb_branch:master" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 353 | tags: "cbb_config:build_tester" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 354 | tags: "cbb_display_label:TestLabel" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 355 | properties: "cbb_branch:master" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 356 | properties: "cbb_config:build_tester" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 357 | properties: "cbb_display_label:TestLabel" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 358 | properties: "cbb_extra_args:[\\"--buildbot\\"]" |
| 359 | } |
| 360 | } |
| 361 | |
| 362 | job { |
| 363 | id: "build_triggered_a" |
| 364 | acl_sets: "default" |
| 365 | schedule: "triggered" |
| 366 | buildbucket: { |
| 367 | server: "cr-buildbucket.appspot.com" |
| 368 | bucket: "luci.chromeos.general" |
| 369 | builder: "ProdBuilder" |
| 370 | tags: "cbb_branch:master" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 371 | tags: "cbb_config:build_triggered_a" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 372 | tags: "cbb_display_label:MockLabel" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 373 | properties: "cbb_branch:master" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 374 | properties: "cbb_config:build_triggered_a" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 375 | properties: "cbb_display_label:MockLabel" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 376 | properties: "cbb_extra_args:[\\"--buildbot\\"]" |
| 377 | } |
| 378 | } |
| 379 | |
| 380 | job { |
| 381 | id: "build_triggered_b" |
| 382 | acl_sets: "default" |
| 383 | schedule: "triggered" |
| 384 | buildbucket: { |
| 385 | server: "cr-buildbucket.appspot.com" |
| 386 | bucket: "luci.chromeos.general" |
| 387 | builder: "ProdBuilder" |
| 388 | tags: "cbb_branch:master" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 389 | tags: "cbb_config:build_triggered_b" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 390 | tags: "cbb_display_label:MockLabel" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 391 | properties: "cbb_branch:master" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 392 | properties: "cbb_config:build_triggered_b" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 393 | properties: "cbb_display_label:MockLabel" |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 394 | properties: "cbb_extra_args:[\\"--buildbot\\"]" |
| 395 | } |
| 396 | } |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 397 | |
| 398 | job { |
| 399 | id: "test-branch-branch_tester" |
| 400 | acl_sets: "default" |
| 401 | schedule: "run daily" |
| 402 | buildbucket: { |
| 403 | server: "cr-buildbucket.appspot.com" |
| 404 | bucket: "luci.chromeos.general" |
| 405 | builder: "TestBuilder" |
| 406 | tags: "cbb_branch:test-branch" |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 407 | tags: "cbb_config:branch_tester" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 408 | tags: "cbb_display_label:TestLabel" |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 409 | properties: "cbb_branch:test-branch" |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 410 | properties: "cbb_config:branch_tester" |
Don Garrett | 73148e5 | 2018-08-17 16:54:46 -0700 | [diff] [blame] | 411 | properties: "cbb_display_label:TestLabel" |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 412 | properties: "cbb_extra_args:[\\"--buildbot\\"]" |
| 413 | } |
| 414 | } |
Don Garrett | 9a0d90c | 2018-10-30 12:47:14 -0700 | [diff] [blame] | 415 | |
| 416 | job { |
| 417 | id: "test-branch-branch_tester_triggered" |
| 418 | acl_sets: "default" |
| 419 | schedule: "run daily" |
| 420 | buildbucket: { |
| 421 | server: "cr-buildbucket.appspot.com" |
| 422 | bucket: "luci.chromeos.general" |
| 423 | builder: "TestBuilder" |
| 424 | tags: "cbb_branch:test-branch" |
| 425 | tags: "cbb_config:branch_tester_triggered" |
| 426 | tags: "cbb_display_label:TestLabel" |
| 427 | properties: "cbb_branch:test-branch" |
| 428 | properties: "cbb_config:branch_tester_triggered" |
| 429 | properties: "cbb_display_label:TestLabel" |
| 430 | properties: "cbb_extra_args:[\\"--buildbot\\"]" |
| 431 | } |
| 432 | } |
Mike Frysinger | 80de501 | 2019-08-01 14:10:53 -0400 | [diff] [blame] | 433 | """ |
Don Garrett | 8dace27 | 2018-07-19 14:07:42 -0700 | [diff] [blame] | 434 | result = gen_luci_scheduler.genLuciSchedulerConfig( |
| 435 | site_config, branch_configs) |
Don Garrett | be3608b | 2018-06-05 17:10:09 -0700 | [diff] [blame] | 436 | |
| 437 | self.assertEqual(result, expected) |