Add queue-name parameter to job
Allow an optional queue-name parameter to be set for a job.
As projects with that job are combined with others into shared
change queues, give the queue that name. This allows us to, say,
set the queue name of the tempest gate job to 'integrated' and
end up with the shared change queue of all the OpenStack integrated
projects named 'integrated'.
With that, we can do things like emit stats for the 'integrated'
queue.
Change-Id: Iafd218d7cd519312ccbf97de7c070e8d3b82038c
diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py
index 9576440..4758155 100755
--- a/tests/test_scheduler.py
+++ b/tests/test_scheduler.py
@@ -2893,6 +2893,21 @@
self.assertTrue(re.search("project-test2.*SUCCESS", desc))
self.assertTrue(re.search("Reported result.*SUCCESS", desc))
+ def test_queue_names(self):
+ "Test shared change queue names"
+ project1 = self.sched.layout.projects['org/project1']
+ project2 = self.sched.layout.projects['org/project2']
+ q1 = self.sched.layout.pipelines['gate'].getQueue(project1)
+ q2 = self.sched.layout.pipelines['gate'].getQueue(project2)
+ self.assertEqual(q1.name, 'integration')
+ self.assertEqual(q2.name, 'integration')
+
+ self.config.set('zuul', 'layout_config',
+ 'tests/fixtures/layout-bad-queue.yaml')
+ with testtools.ExpectedException(
+ Exception, "More than one name assigned to change queue"):
+ self.sched.reconfigure(self.config)
+
def test_queue_precedence(self):
"Test that queue precedence works"