Re-enable test_layered_templates test

Change-Id: Ica7deccdc1d6183ba5e781df020f7e77294e6e25
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2016-11-03 14:57:31 -04:00
parent 86085b302e
commit 3adf72f4fc
4 changed files with 54 additions and 45 deletions

View File

@ -53,13 +53,45 @@
- project-test1
- project-test2
- project-template:
name: test-three-and-four
check:
jobs:
- layered-project-test3
- layered-project-test4
- project-template:
name: test-five
check:
jobs:
- layered-project-foo-test5
- job:
name: project-test1
- job:
name: project-test2
- job:
name: layered-project-test3
- job:
name: layered-project-test4
- job:
name: layered-project-foo-test5
- project:
name: org/templated-project
templates:
- test-one-and-two
- project:
name: org/layered-project
templates:
- test-one-and-two
- test-three-and-four
- test-five
check:
jobs:
- project-test6

View File

@ -0,0 +1 @@
test

View File

@ -142,19 +142,6 @@ jobs:
- project1
- extratag
project-templates:
- name: test-one-and-two
check:
- '{projectname}-test1'
- '{projectname}-test2'
- name: test-three-and-four
check:
- '{name}-test3'
- '{name}-test4'
- name: test-five
check:
- '{name}-{something}-test5'
projects:
- name: org/project
merge-mode: cherry-pick
@ -229,16 +216,6 @@ projects:
post:
- nonvoting-project-post
- name: org/layered-project
template:
- name: test-one-and-two
projectname: project
- name: test-three-and-four
- name: test-five
something: foo
check:
- project-test6
- name: org/node-project
gate:
- node-project-merge:

View File

@ -1226,28 +1226,6 @@ jobs:
self.assertNotEqual(ref_A, ref_B, ref_C)
self.assertNotEqual(commit_A, commit_B, commit_C)
@skip("Disabled for early v3 development")
def test_layered_templates(self):
"Test whether a job generated via a template can be launched"
A = self.fake_gerrit.addFakeChange(
'org/layered-project', 'master', 'A')
self.fake_gerrit.addEvent(A.getPatchsetCreatedEvent(1))
self.waitUntilSettled()
self.assertEqual(self.getJobFromHistory('project-test1').result,
'SUCCESS')
self.assertEqual(self.getJobFromHistory('project-test2').result,
'SUCCESS')
self.assertEqual(self.getJobFromHistory('layered-project-test3'
).result, 'SUCCESS')
self.assertEqual(self.getJobFromHistory('layered-project-test4'
).result, 'SUCCESS')
self.assertEqual(self.getJobFromHistory('layered-project-foo-test5'
).result, 'SUCCESS')
self.assertEqual(self.getJobFromHistory('project-test6').result,
'SUCCESS')
def test_dependent_changes_dequeue(self):
"Test that dependent patches are not needlessly tested"
@ -4682,3 +4660,24 @@ class TestSchedulerTemplatedProject(ZuulTestCase):
'SUCCESS')
self.assertEqual(self.getJobFromHistory('project-test2').result,
'SUCCESS')
def test_layered_templates(self):
"Test whether a job generated via a template can be launched"
A = self.fake_gerrit.addFakeChange(
'org/layered-project', 'master', 'A')
self.fake_gerrit.addEvent(A.getPatchsetCreatedEvent(1))
self.waitUntilSettled()
self.assertEqual(self.getJobFromHistory('project-test1').result,
'SUCCESS')
self.assertEqual(self.getJobFromHistory('project-test2').result,
'SUCCESS')
self.assertEqual(self.getJobFromHistory('layered-project-test3'
).result, 'SUCCESS')
self.assertEqual(self.getJobFromHistory('layered-project-test4'
).result, 'SUCCESS')
self.assertEqual(self.getJobFromHistory('layered-project-foo-test5'
).result, 'SUCCESS')
self.assertEqual(self.getJobFromHistory('project-test6').result,
'SUCCESS')