Re-enable test_crd_check_unknown test

Since it is possible for createJobTree() to have an unknown project,
we need to properly hand that for project_configs().

Change-Id: I29f10110027c24e9a47a371a3b608262137d5b60
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2016-11-11 19:04:24 -05:00
parent ce4485fdd3
commit 160cb8e417
3 changed files with 4 additions and 3 deletions

View File

@ -0,0 +1 @@
test

View File

@ -4356,7 +4356,6 @@ For CI problems and help debugging, contact ci@example.org"""
self.waitUntilSettled()
self.assertEqual(self.history[-1].changes, '3,2 2,1 1,2')
@skip("Disabled for early v3 development")
def test_crd_check_unknown(self):
"Test unknown projects in independent pipeline"
self.init_repo("org/unknown")

View File

@ -1771,11 +1771,12 @@ class Layout(object):
self._createJobTree(change, tree.job_trees, frozen_tree)
def createJobTree(self, item):
project_config = self.project_configs[item.change.project.name]
project_config = self.project_configs.get(
item.change.project.name, None)
ret = JobTree(None)
# 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:
if project_config and 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)