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