Re-enable test_job_from_templates_launched job
There is a slight different in the zuulv3 syntax, we appear to lose the ability to define template variables. The zuul configuration has been updated accordingly. Change-Id: I060eab9df841ce7ebcc6ae367e2122c5e7c01f55 Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
parent
fac69baa7a
commit
86085b302e
65
tests/fixtures/config/templated-project/git/common-config/zuul.yaml
vendored
Normal file
65
tests/fixtures/config/templated-project/git/common-config/zuul.yaml
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
- pipeline:
|
||||
name: check
|
||||
manager: independent
|
||||
source:
|
||||
gerrit
|
||||
trigger:
|
||||
gerrit:
|
||||
- event: patchset-created
|
||||
success:
|
||||
gerrit:
|
||||
verified: 1
|
||||
failure:
|
||||
gerrit:
|
||||
verified: -1
|
||||
|
||||
- pipeline:
|
||||
name: gate
|
||||
manager: dependent
|
||||
success-message: Build succeeded (gate).
|
||||
source:
|
||||
gerrit
|
||||
trigger:
|
||||
gerrit:
|
||||
- event: comment-added
|
||||
approval:
|
||||
- approved: 1
|
||||
success:
|
||||
gerrit:
|
||||
verified: 2
|
||||
submit: true
|
||||
failure:
|
||||
gerrit:
|
||||
verified: -2
|
||||
start:
|
||||
gerrit:
|
||||
verified: 0
|
||||
precedence: high
|
||||
|
||||
- pipeline:
|
||||
name: post
|
||||
manager: independent
|
||||
source:
|
||||
gerrit
|
||||
trigger:
|
||||
gerrit:
|
||||
- event: ref-updated
|
||||
ref: ^(?!refs/).*$
|
||||
|
||||
- project-template:
|
||||
name: test-one-and-two
|
||||
check:
|
||||
jobs:
|
||||
- project-test1
|
||||
- project-test2
|
||||
|
||||
- job:
|
||||
name: project-test1
|
||||
|
||||
- job:
|
||||
name: project-test2
|
||||
|
||||
- project:
|
||||
name: org/templated-project
|
||||
templates:
|
||||
- test-one-and-two
|
1
tests/fixtures/config/templated-project/git/org_templated-project/README
vendored
Normal file
1
tests/fixtures/config/templated-project/git/org_templated-project/README
vendored
Normal file
@ -0,0 +1 @@
|
||||
test
|
6
tests/fixtures/config/templated-project/main.yaml
vendored
Normal file
6
tests/fixtures/config/templated-project/main.yaml
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
- tenant:
|
||||
name: tenant-one
|
||||
source:
|
||||
gerrit:
|
||||
config-repos:
|
||||
- common-config
|
5
tests/fixtures/layout.yaml
vendored
5
tests/fixtures/layout.yaml
vendored
@ -229,11 +229,6 @@ projects:
|
||||
post:
|
||||
- nonvoting-project-post
|
||||
|
||||
- name: org/templated-project
|
||||
template:
|
||||
- name: test-one-and-two
|
||||
projectname: project
|
||||
|
||||
- name: org/layered-project
|
||||
template:
|
||||
- name: test-one-and-two
|
||||
|
@ -1226,20 +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_job_from_templates_launched(self):
|
||||
"Test whether a job generated via a template can be launched"
|
||||
|
||||
A = self.fake_gerrit.addFakeChange(
|
||||
'org/templated-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')
|
||||
|
||||
@skip("Disabled for early v3 development")
|
||||
def test_layered_templates(self):
|
||||
"Test whether a job generated via a template can be launched"
|
||||
@ -4679,3 +4665,20 @@ class TestSchedulerOneJobProject(ZuulTestCase):
|
||||
self.assertEqual(A.reported, 2)
|
||||
self.assertEqual(B.data['status'], 'MERGED')
|
||||
self.assertEqual(B.reported, 2)
|
||||
|
||||
|
||||
class TestSchedulerTemplatedProject(ZuulTestCase):
|
||||
tenant_config_file = 'config/templated-project/main.yaml'
|
||||
|
||||
def test_job_from_templates_launched(self):
|
||||
"Test whether a job generated via a template can be launched"
|
||||
|
||||
A = self.fake_gerrit.addFakeChange(
|
||||
'org/templated-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')
|
||||
|
Loading…
Reference in New Issue
Block a user