blob: 07fd8fca51ac6ec7aa75c9467a79abd3410ad484 [file] [log] [blame]
Mike Frysingerf1ba7ad2022-09-12 05:42:57 -04001# Copyright 2018 The ChromiumOS Authors
Don Garrettbe3608b2018-06-05 17:10:09 -07002# 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 Garrettbe3608b2018-06-05 17:10:09 -07006
Don Garrett8dace272018-07-19 14:07:42 -07007from chromite.config import chromeos_config
Don Garrettbe3608b2018-06-05 17:10:09 -07008from chromite.lib import config_lib
9from chromite.lib import config_lib_unittest
Mike Frysinger807d8282022-04-28 22:45:17 -040010from chromite.lib import cros_test_lib
Don Garrettbe3608b2018-06-05 17:10:09 -070011from chromite.scripts import gen_luci_scheduler
12
Mike Frysinger74a6cc82020-02-14 14:16:22 -050013
Don Garrettbe3608b2018-06-05 17:10:09 -070014# It's reasonable for unittests to look at internals.
15# pylint: disable=protected-access
16
17
18class GenLuciSchedulerTest(cros_test_lib.MockTestCase):
Alex Klein1699fab2022-09-08 08:46:06 -060019 """Tests for cbuildbot_launch script."""
Don Garrettbe3608b2018-06-05 17:10:09 -070020
Alex Klein1699fab2022-09-08 08:46:06 -060021 def testSanityAgainstProd(self):
22 """Test we can generate a luci scheduler config with live data."""
23 # If it runs without crashing, we pass.
24 gen_luci_scheduler.genLuciSchedulerConfig(
25 config_lib.GetConfig(), chromeos_config.BranchScheduleConfig()
26 )
Don Garrettbe3608b2018-06-05 17:10:09 -070027
Alex Klein1699fab2022-09-08 08:46:06 -060028 def testGenSchedulerJob(self):
29 """Test the job creation helper."""
30 build_config = config_lib_unittest.MockBuildConfig().apply(
31 schedule="funky schedule"
32 )
33
34 expected = """
Don Garrettbe3608b2018-06-05 17:10:09 -070035job {
Mike Nichols9e47e842020-08-11 15:23:56 -060036 id: "amd64-generic-release"
Vadim Shtayura6398e002021-01-11 12:02:11 -080037 realm: "cbb-jobs"
Don Garrettbe3608b2018-06-05 17:10:09 -070038 acl_sets: "default"
39 schedule: "funky schedule"
40 buildbucket: {
41 server: "cr-buildbucket.appspot.com"
Vadim Shtayura959cb0f2022-02-03 12:45:58 -080042 bucket: "general"
Mike Nichols9e47e842020-08-11 15:23:56 -060043 builder: "LegacyRelease"
Mike Frysinger62a02452021-03-16 03:48:34 -040044 tags: "cbb_branch:main"
Mike Nichols9e47e842020-08-11 15:23:56 -060045 tags: "cbb_config:amd64-generic-release"
Don Garrett73148e52018-08-17 16:54:46 -070046 tags: "cbb_display_label:MockLabel"
Mike Frysinger62a02452021-03-16 03:48:34 -040047 properties: "cbb_branch:main"
Mike Nichols9e47e842020-08-11 15:23:56 -060048 properties: "cbb_config:amd64-generic-release"
Don Garrett73148e52018-08-17 16:54:46 -070049 properties: "cbb_display_label:MockLabel"
Don Garrettbe3608b2018-06-05 17:10:09 -070050 properties: "cbb_extra_args:[\\"--buildbot\\"]"
51 }
52}
Mike Frysinger80de5012019-08-01 14:10:53 -040053"""
Don Garrettbe3608b2018-06-05 17:10:09 -070054
Alex Klein1699fab2022-09-08 08:46:06 -060055 result = gen_luci_scheduler.genSchedulerJob(build_config)
56 self.assertEqual(result, expected)
Don Garrettbe3608b2018-06-05 17:10:09 -070057
Alex Klein1699fab2022-09-08 08:46:06 -060058 def testGenSchedulerTriggerSimple(self):
59 """Test the trigger creation helper."""
60 trigger_name = "simple"
61 repo = "url://repo"
62 refs = ["refs/path"]
63 path_regexps = ["path/regexps"]
64 builds = ["test_build"]
Don Garrettbe3608b2018-06-05 17:10:09 -070065
Alex Klein1699fab2022-09-08 08:46:06 -060066 expected = """
Don Garrettbe3608b2018-06-05 17:10:09 -070067trigger {
68 id: "simple"
Vadim Shtayura6398e002021-01-11 12:02:11 -080069 realm: "cbb-jobs"
Don Garrettbe3608b2018-06-05 17:10:09 -070070 acl_sets: "default"
71 schedule: "with 5m interval"
72 gitiles: {
73 repo: "url://repo"
74 refs: "refs/path"
David Burgercba0d272020-06-24 16:21:26 -060075 path_regexps: "path/regexps"
Don Garrettbe3608b2018-06-05 17:10:09 -070076 }
77 triggers: "test_build"
78}
Mike Frysinger80de5012019-08-01 14:10:53 -040079"""
Don Garrettbe3608b2018-06-05 17:10:09 -070080
Alex Klein1699fab2022-09-08 08:46:06 -060081 result = gen_luci_scheduler.genSchedulerTrigger(
82 trigger_name, repo, refs, path_regexps, builds
83 )
Don Garrettbe3608b2018-06-05 17:10:09 -070084
Alex Klein1699fab2022-09-08 08:46:06 -060085 self.assertEqual(result, expected)
Don Garrettbe3608b2018-06-05 17:10:09 -070086
Alex Klein1699fab2022-09-08 08:46:06 -060087 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"]
Don Garrettbe3608b2018-06-05 17:10:09 -070093
Alex Klein1699fab2022-09-08 08:46:06 -060094 expected = """
Don Garrettbe3608b2018-06-05 17:10:09 -070095trigger {
96 id: "complex"
Vadim Shtayura6398e002021-01-11 12:02:11 -080097 realm: "cbb-jobs"
Don Garrettbe3608b2018-06-05 17:10:09 -070098 acl_sets: "default"
99 schedule: "with 5m interval"
100 gitiles: {
101 repo: "url://repo"
102 refs: "refs/path"
103 refs: "refs/other_path"
104 }
105 triggers: "test_build_a"
106 triggers: "test_build_b"
107}
Mike Frysinger80de5012019-08-01 14:10:53 -0400108"""
Don Garrettbe3608b2018-06-05 17:10:09 -0700109
Alex Klein1699fab2022-09-08 08:46:06 -0600110 result = gen_luci_scheduler.genSchedulerTrigger(
111 trigger_name, repo, refs, None, builds
112 )
Don Garrettbe3608b2018-06-05 17:10:09 -0700113
Alex Klein1699fab2022-09-08 08:46:06 -0600114 self.assertEqual(result, expected)
Don Garrettbe3608b2018-06-05 17:10:09 -0700115
Alex Klein1699fab2022-09-08 08:46:06 -0600116 def testGenSchedulerBranched(self):
117 """Test the job creation helper."""
118 build_config = config_lib_unittest.MockBuildConfig().apply(
119 schedule_branch="mock_branch",
120 schedule="funky schedule",
121 )
Don Garrett8dace272018-07-19 14:07:42 -0700122
Alex Klein1699fab2022-09-08 08:46:06 -0600123 expected = """
Don Garrett8dace272018-07-19 14:07:42 -0700124job {
Mike Nichols9e47e842020-08-11 15:23:56 -0600125 id: "mock_branch-amd64-generic-release"
Vadim Shtayura6398e002021-01-11 12:02:11 -0800126 realm: "cbb-jobs"
Don Garrett8dace272018-07-19 14:07:42 -0700127 acl_sets: "default"
128 schedule: "funky schedule"
129 buildbucket: {
130 server: "cr-buildbucket.appspot.com"
Vadim Shtayura959cb0f2022-02-03 12:45:58 -0800131 bucket: "general"
Mike Nichols9e47e842020-08-11 15:23:56 -0600132 builder: "LegacyRelease"
Don Garrett8dace272018-07-19 14:07:42 -0700133 tags: "cbb_branch:mock_branch"
Mike Nichols9e47e842020-08-11 15:23:56 -0600134 tags: "cbb_config:amd64-generic-release"
Don Garrett73148e52018-08-17 16:54:46 -0700135 tags: "cbb_display_label:MockLabel"
Don Garrett8dace272018-07-19 14:07:42 -0700136 properties: "cbb_branch:mock_branch"
Mike Nichols9e47e842020-08-11 15:23:56 -0600137 properties: "cbb_config:amd64-generic-release"
Don Garrett73148e52018-08-17 16:54:46 -0700138 properties: "cbb_display_label:MockLabel"
139 properties: "cbb_extra_args:[\\"--buildbot\\"]"
140 }
141}
Mike Frysinger80de5012019-08-01 14:10:53 -0400142"""
Don Garrett73148e52018-08-17 16:54:46 -0700143
Alex Klein1699fab2022-09-08 08:46:06 -0600144 result = gen_luci_scheduler.genSchedulerJob(build_config)
145 self.assertEqual(result, expected)
Don Garrett73148e52018-08-17 16:54:46 -0700146
Alex Klein1699fab2022-09-08 08:46:06 -0600147 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 )
Don Garrett73148e52018-08-17 16:54:46 -0700153
Alex Klein1699fab2022-09-08 08:46:06 -0600154 expected = """
Don Garrett73148e52018-08-17 16:54:46 -0700155job {
Mike Nichols9e47e842020-08-11 15:23:56 -0600156 id: "amd64-generic-release"
Vadim Shtayura6398e002021-01-11 12:02:11 -0800157 realm: "cbb-jobs"
Don Garrett73148e52018-08-17 16:54:46 -0700158 acl_sets: "default"
159 schedule: "funky schedule"
160 buildbucket: {
161 server: "cr-buildbucket.appspot.com"
Vadim Shtayura959cb0f2022-02-03 12:45:58 -0800162 bucket: "general"
Mike Nichols9e47e842020-08-11 15:23:56 -0600163 builder: "LegacyRelease"
Mike Frysinger62a02452021-03-16 03:48:34 -0400164 tags: "cbb_branch:main"
Mike Nichols9e47e842020-08-11 15:23:56 -0600165 tags: "cbb_config:amd64-generic-release"
Don Garrett73148e52018-08-17 16:54:46 -0700166 tags: "cbb_display_label:MockLabel"
167 tags: "cbb_workspace_branch:work_branch"
Mike Frysinger62a02452021-03-16 03:48:34 -0400168 properties: "cbb_branch:main"
Mike Nichols9e47e842020-08-11 15:23:56 -0600169 properties: "cbb_config:amd64-generic-release"
Don Garrett73148e52018-08-17 16:54:46 -0700170 properties: "cbb_display_label:MockLabel"
171 properties: "cbb_workspace_branch:work_branch"
Don Garrett8dace272018-07-19 14:07:42 -0700172 properties: "cbb_extra_args:[\\"--buildbot\\"]"
173 }
174}
Mike Frysinger80de5012019-08-01 14:10:53 -0400175"""
Don Garrett8dace272018-07-19 14:07:42 -0700176
Alex Klein1699fab2022-09-08 08:46:06 -0600177 result = gen_luci_scheduler.genSchedulerJob(build_config)
178 self.assertEqual(result, expected)
Don Garrett8dace272018-07-19 14:07:42 -0700179
Alex Klein1699fab2022-09-08 08:46:06 -0600180 def testGenLuciSchedulerConfig(self):
181 """Test a full LUCI Scheduler config file."""
182 site_config = config_lib.SiteConfig()
Don Garrettbe3608b2018-06-05 17:10:09 -0700183
Alex Klein1699fab2022-09-08 08:46:06 -0600184 site_config.Add(
185 "not_scheduled",
186 luci_builder="ReleaseBuilder",
187 display_label="MockLabel",
188 )
Don Garrettbe3608b2018-06-05 17:10:09 -0700189
Alex Klein1699fab2022-09-08 08:46:06 -0600190 site_config.Add(
191 "build_prod",
192 luci_builder="ReleaseBuilder",
193 display_label="MockLabel",
194 schedule="run once in a while",
195 )
Don Garrettbe3608b2018-06-05 17:10:09 -0700196
Alex Klein1699fab2022-09-08 08:46:06 -0600197 site_config.Add(
198 "build_tester",
199 luci_builder="TestBuilder",
200 display_label="TestLabel",
201 schedule="run daily",
202 )
Don Garrettbe3608b2018-06-05 17:10:09 -0700203
Alex Klein1699fab2022-09-08 08:46:06 -0600204 site_config.Add(
205 "build_triggered_a",
206 luci_builder="ReleaseBuilder",
207 display_label="MockLabel",
208 schedule="triggered",
209 triggered_gitiles=[
210 [
211 "gitiles_url_a",
212 ["ref_a", "ref_b"],
213 ],
214 [
215 "gitiles_url_b",
216 ["ref_c"],
217 ],
218 ],
219 )
Don Garrettbe3608b2018-06-05 17:10:09 -0700220
Alex Klein1699fab2022-09-08 08:46:06 -0600221 site_config.Add(
222 "build_triggered_b",
223 luci_builder="ProdBuilder",
224 display_label="MockLabel",
225 schedule="triggered",
226 triggered_gitiles=[
227 [
228 "gitiles_url_b",
229 ["ref_c"],
230 ]
231 ],
232 )
Don Garrettbe3608b2018-06-05 17:10:09 -0700233
Alex Klein1699fab2022-09-08 08:46:06 -0600234 default_config = config_lib.GetConfig().GetDefault()
Don Garrett8dace272018-07-19 14:07:42 -0700235
Alex Klein1699fab2022-09-08 08:46:06 -0600236 branch_configs = [
237 default_config.derive(
238 name="branch_tester",
239 luci_builder="TestBuilder",
240 display_label="TestLabel",
241 schedule="run daily",
242 schedule_branch="test-branch",
243 ),
244 default_config.derive(
245 name="branch_tester_triggered",
246 luci_builder="TestBuilder",
247 display_label="TestLabel",
248 schedule="run daily",
249 schedule_branch="test-branch",
250 triggered_gitiles=[
251 [
252 "gitiles_url_a",
253 ["ref_a", "ref_b"],
254 ]
255 ],
256 ),
257 ]
Don Garrett8dace272018-07-19 14:07:42 -0700258
Alex Klein1699fab2022-09-08 08:46:06 -0600259 expected = """# Defines buckets on luci-scheduler.appspot.com.
Don Garrettbe3608b2018-06-05 17:10:09 -0700260#
261# For schema of this file and documentation see ProjectConfig message in
Mike Frysinger92dc6492021-02-17 16:01:09 -0500262# https://github.com/luci/luci-go/blob/HEAD/scheduler/appengine/messages/config.proto
Don Garrettbe3608b2018-06-05 17:10:09 -0700263
264# Generated with chromite/scripts/gen_luci_scheduler
265
Don Garrettff45f4b2018-10-04 09:08:01 -0700266# Autodeployed with:
Mike Nicholsb575c612021-04-09 10:04:43 -0600267# https://data.corp.google.com/sites/chromeos_ci_cros_ci_builds/utility/?f=board_name:in:luci-scheduler-updater
Don Garrettff45f4b2018-10-04 09:08:01 -0700268
Don Garrettbe3608b2018-06-05 17:10:09 -0700269acl_sets {
270 name: "default"
271 acls {
272 role: READER
273 granted_to: "group:googlers"
274 }
275 acls {
276 role: OWNER
277 granted_to: "group:project-chromeos-admins"
278 }
Jason D. Clintona9e374a2018-10-18 18:41:00 -0600279 acls {
280 role: TRIGGERER
281 granted_to: "group:mdb/chromeos-build-access"
LaMont Jones48ddfd92020-09-16 13:46:41 -0600282 }
283 acls {
284 role: TRIGGERER
LaMont Jonesd1bb0002020-09-16 09:35:10 -0600285 granted_to: "group:project-chromeos-buildbucket-schedulers"
Jason D. Clintona9e374a2018-10-18 18:41:00 -0600286 }
Don Garrettbe3608b2018-06-05 17:10:09 -0700287}
288
289trigger {
290 id: "trigger_0"
Vadim Shtayura6398e002021-01-11 12:02:11 -0800291 realm: "cbb-jobs"
Don Garrettbe3608b2018-06-05 17:10:09 -0700292 acl_sets: "default"
293 schedule: "with 5m interval"
294 gitiles: {
295 repo: "gitiles_url_a"
296 refs: "ref_a"
297 refs: "ref_b"
298 }
299 triggers: "build_triggered_a"
Don Garrett9a0d90c2018-10-30 12:47:14 -0700300 triggers: "test-branch-branch_tester_triggered"
Don Garrettbe3608b2018-06-05 17:10:09 -0700301}
302
303trigger {
304 id: "trigger_1"
Vadim Shtayura6398e002021-01-11 12:02:11 -0800305 realm: "cbb-jobs"
Don Garrettbe3608b2018-06-05 17:10:09 -0700306 acl_sets: "default"
307 schedule: "with 5m interval"
308 gitiles: {
309 repo: "gitiles_url_b"
310 refs: "ref_c"
311 }
312 triggers: "build_triggered_a"
313 triggers: "build_triggered_b"
314}
315
316job {
317 id: "build_prod"
Vadim Shtayura6398e002021-01-11 12:02:11 -0800318 realm: "cbb-jobs"
Don Garrettbe3608b2018-06-05 17:10:09 -0700319 acl_sets: "default"
320 schedule: "run once in a while"
321 buildbucket: {
322 server: "cr-buildbucket.appspot.com"
Vadim Shtayura959cb0f2022-02-03 12:45:58 -0800323 bucket: "general"
Mike Nichols9e47e842020-08-11 15:23:56 -0600324 builder: "ReleaseBuilder"
Mike Frysinger62a02452021-03-16 03:48:34 -0400325 tags: "cbb_branch:main"
Don Garrettbe3608b2018-06-05 17:10:09 -0700326 tags: "cbb_config:build_prod"
Don Garrett73148e52018-08-17 16:54:46 -0700327 tags: "cbb_display_label:MockLabel"
Mike Frysinger62a02452021-03-16 03:48:34 -0400328 properties: "cbb_branch:main"
Don Garrettbe3608b2018-06-05 17:10:09 -0700329 properties: "cbb_config:build_prod"
Don Garrett73148e52018-08-17 16:54:46 -0700330 properties: "cbb_display_label:MockLabel"
Don Garrettbe3608b2018-06-05 17:10:09 -0700331 properties: "cbb_extra_args:[\\"--buildbot\\"]"
332 }
333}
334
335job {
336 id: "build_tester"
Vadim Shtayura6398e002021-01-11 12:02:11 -0800337 realm: "cbb-jobs"
Don Garrettbe3608b2018-06-05 17:10:09 -0700338 acl_sets: "default"
339 schedule: "run daily"
340 buildbucket: {
341 server: "cr-buildbucket.appspot.com"
Vadim Shtayura959cb0f2022-02-03 12:45:58 -0800342 bucket: "general"
Don Garrettbe3608b2018-06-05 17:10:09 -0700343 builder: "TestBuilder"
Mike Frysinger62a02452021-03-16 03:48:34 -0400344 tags: "cbb_branch:main"
Don Garrettbe3608b2018-06-05 17:10:09 -0700345 tags: "cbb_config:build_tester"
Don Garrett73148e52018-08-17 16:54:46 -0700346 tags: "cbb_display_label:TestLabel"
Mike Frysinger62a02452021-03-16 03:48:34 -0400347 properties: "cbb_branch:main"
Don Garrettbe3608b2018-06-05 17:10:09 -0700348 properties: "cbb_config:build_tester"
Don Garrett73148e52018-08-17 16:54:46 -0700349 properties: "cbb_display_label:TestLabel"
Don Garrettbe3608b2018-06-05 17:10:09 -0700350 properties: "cbb_extra_args:[\\"--buildbot\\"]"
351 }
352}
353
354job {
355 id: "build_triggered_a"
Vadim Shtayura6398e002021-01-11 12:02:11 -0800356 realm: "cbb-jobs"
Don Garrettbe3608b2018-06-05 17:10:09 -0700357 acl_sets: "default"
358 schedule: "triggered"
359 buildbucket: {
360 server: "cr-buildbucket.appspot.com"
Vadim Shtayura959cb0f2022-02-03 12:45:58 -0800361 bucket: "general"
Mike Nichols9e47e842020-08-11 15:23:56 -0600362 builder: "ReleaseBuilder"
Mike Frysinger62a02452021-03-16 03:48:34 -0400363 tags: "cbb_branch:main"
Don Garrettbe3608b2018-06-05 17:10:09 -0700364 tags: "cbb_config:build_triggered_a"
Don Garrett73148e52018-08-17 16:54:46 -0700365 tags: "cbb_display_label:MockLabel"
Mike Frysinger62a02452021-03-16 03:48:34 -0400366 properties: "cbb_branch:main"
Don Garrettbe3608b2018-06-05 17:10:09 -0700367 properties: "cbb_config:build_triggered_a"
Don Garrett73148e52018-08-17 16:54:46 -0700368 properties: "cbb_display_label:MockLabel"
Don Garrettbe3608b2018-06-05 17:10:09 -0700369 properties: "cbb_extra_args:[\\"--buildbot\\"]"
370 }
371}
372
373job {
374 id: "build_triggered_b"
Vadim Shtayura6398e002021-01-11 12:02:11 -0800375 realm: "cbb-jobs"
Don Garrettbe3608b2018-06-05 17:10:09 -0700376 acl_sets: "default"
377 schedule: "triggered"
378 buildbucket: {
379 server: "cr-buildbucket.appspot.com"
Vadim Shtayura959cb0f2022-02-03 12:45:58 -0800380 bucket: "general"
Don Garrettbe3608b2018-06-05 17:10:09 -0700381 builder: "ProdBuilder"
Mike Frysinger62a02452021-03-16 03:48:34 -0400382 tags: "cbb_branch:main"
Don Garrettbe3608b2018-06-05 17:10:09 -0700383 tags: "cbb_config:build_triggered_b"
Don Garrett73148e52018-08-17 16:54:46 -0700384 tags: "cbb_display_label:MockLabel"
Mike Frysinger62a02452021-03-16 03:48:34 -0400385 properties: "cbb_branch:main"
Don Garrettbe3608b2018-06-05 17:10:09 -0700386 properties: "cbb_config:build_triggered_b"
Don Garrett73148e52018-08-17 16:54:46 -0700387 properties: "cbb_display_label:MockLabel"
Don Garrettbe3608b2018-06-05 17:10:09 -0700388 properties: "cbb_extra_args:[\\"--buildbot\\"]"
389 }
390}
Don Garrett8dace272018-07-19 14:07:42 -0700391
392job {
393 id: "test-branch-branch_tester"
Vadim Shtayura6398e002021-01-11 12:02:11 -0800394 realm: "cbb-jobs"
Don Garrett8dace272018-07-19 14:07:42 -0700395 acl_sets: "default"
396 schedule: "run daily"
397 buildbucket: {
398 server: "cr-buildbucket.appspot.com"
Vadim Shtayura959cb0f2022-02-03 12:45:58 -0800399 bucket: "general"
Don Garrett8dace272018-07-19 14:07:42 -0700400 builder: "TestBuilder"
401 tags: "cbb_branch:test-branch"
Don Garrett8dace272018-07-19 14:07:42 -0700402 tags: "cbb_config:branch_tester"
Don Garrett73148e52018-08-17 16:54:46 -0700403 tags: "cbb_display_label:TestLabel"
Don Garrett8dace272018-07-19 14:07:42 -0700404 properties: "cbb_branch:test-branch"
Don Garrett8dace272018-07-19 14:07:42 -0700405 properties: "cbb_config:branch_tester"
Don Garrett73148e52018-08-17 16:54:46 -0700406 properties: "cbb_display_label:TestLabel"
Don Garrett8dace272018-07-19 14:07:42 -0700407 properties: "cbb_extra_args:[\\"--buildbot\\"]"
408 }
409}
Don Garrett9a0d90c2018-10-30 12:47:14 -0700410
411job {
412 id: "test-branch-branch_tester_triggered"
Vadim Shtayura6398e002021-01-11 12:02:11 -0800413 realm: "cbb-jobs"
Don Garrett9a0d90c2018-10-30 12:47:14 -0700414 acl_sets: "default"
415 schedule: "run daily"
416 buildbucket: {
417 server: "cr-buildbucket.appspot.com"
Vadim Shtayura959cb0f2022-02-03 12:45:58 -0800418 bucket: "general"
Don Garrett9a0d90c2018-10-30 12:47:14 -0700419 builder: "TestBuilder"
420 tags: "cbb_branch:test-branch"
421 tags: "cbb_config:branch_tester_triggered"
422 tags: "cbb_display_label:TestLabel"
423 properties: "cbb_branch:test-branch"
424 properties: "cbb_config:branch_tester_triggered"
425 properties: "cbb_display_label:TestLabel"
426 properties: "cbb_extra_args:[\\"--buildbot\\"]"
427 }
428}
Mike Frysinger80de5012019-08-01 14:10:53 -0400429"""
Alex Klein1699fab2022-09-08 08:46:06 -0600430 result = gen_luci_scheduler.genLuciSchedulerConfig(
431 site_config, branch_configs
432 )
Don Garrettbe3608b2018-06-05 17:10:09 -0700433
Alex Klein1699fab2022-09-08 08:46:06 -0600434 self.assertEqual(result, expected)