Re-enable test_nonvoting_pipeline

Here we enabled our nonvoting pipeline test again. It seems we also
needed to create a check pipeline noop job, otherwise our pipeline
queues (for check) would not be empty.

Change-Id: I1269e8de632f847dbacbde187d609bbab1ac8179
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2016-10-14 16:27:34 -04:00
parent 2e2a0496cc
commit 15e3e20936
5 changed files with 34 additions and 5 deletions

View File

@ -36,6 +36,19 @@
verified: 0
precedence: high
- pipeline:
name: experimental
manager: independent
source:
gerrit
trigger:
gerrit:
- event: patchset-created
success:
gerrit: {}
failure:
gerrit: {}
- job:
name: project-merge
hold-following-changes: true
@ -56,6 +69,9 @@
- job:
name: project-test2
- job:
name: experimental-project-test
- project:
name: org/project
gate:
@ -84,3 +100,11 @@
jobs:
- project-test1
- project-test2
- project:
name: org/experimental-project
experimental:
jobs:
- project-merge:
jobs:
- experimental-project-test

View File

@ -0,0 +1 @@
test

View File

@ -3884,7 +3884,6 @@ For CI problems and help debugging, contact ci@example.org"""
running_items = client.get_running_jobs()
self.assertEqual(0, len(running_items))
@skip("Disabled for early v3 development")
def test_nonvoting_pipeline(self):
"Test that a nonvoting pipeline (experimental) can still report"
@ -3892,6 +3891,9 @@ For CI problems and help debugging, contact ci@example.org"""
'master', 'A')
self.fake_gerrit.addEvent(A.getPatchsetCreatedEvent(1))
self.waitUntilSettled()
self.assertEqual(self.getJobFromHistory('project-merge').result,
'SUCCESS')
self.assertEqual(
self.getJobFromHistory('experimental-project-test').result,
'SUCCESS')

View File

@ -29,8 +29,6 @@ class IndependentPipelineManager(PipelineManager):
# creates a new change queue for every change
if existing:
return DynamicChangeQueueContextManager(existing)
if change.project not in self.pipeline.getProjects():
self.pipeline.addProject(change.project)
change_queue = model.ChangeQueue(self.pipeline)
change_queue.addProject(change.project)
self.pipeline.addQueue(change_queue)

View File

@ -1770,9 +1770,13 @@ class Layout(object):
def createJobTree(self, item):
project_config = self.project_configs[item.change.project.name]
project_tree = project_config.pipelines[item.pipeline.name].job_tree
ret = JobTree(None)
self._createJobTree(item.change, project_tree.job_trees, ret)
# NOTE(pabelanger): It is possible for a foreign project not to have a
# configured pipeline, if so return an empty JobTree.
if item.pipeline.name in project_config.pipelines:
project_tree = \
project_config.pipelines[item.pipeline.name].job_tree
self._createJobTree(item.change, project_tree.job_trees, ret)
return ret