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