Support project templates
Change-Id: I37378893e1761fe33c19d936076b9ec3d4c81627
diff --git a/tests/fixtures/config/multi-tenant/tenant-one.yaml b/tests/fixtures/config/multi-tenant/tenant-one.yaml
index c9096ef..874e932 100644
--- a/tests/fixtures/config/multi-tenant/tenant-one.yaml
+++ b/tests/fixtures/config/multi-tenant/tenant-one.yaml
@@ -28,6 +28,8 @@
projects:
- name: org/project1
check:
- - project1-test1
+ jobs:
+ - project1-test1
tenant-one-gate:
- - project1-test1
+ jobs:
+ - project1-test1
diff --git a/tests/fixtures/config/multi-tenant/tenant-two.yaml b/tests/fixtures/config/multi-tenant/tenant-two.yaml
index 6cb2d9a..254d9cd 100644
--- a/tests/fixtures/config/multi-tenant/tenant-two.yaml
+++ b/tests/fixtures/config/multi-tenant/tenant-two.yaml
@@ -28,6 +28,8 @@
projects:
- name: org/project2
check:
- - project2-test1
+ jobs:
+ - project2-test1
tenant-two-gate:
- - project2-test1
+ jobs:
+ - project2-test1
diff --git a/tests/fixtures/config/project-template/common.yaml b/tests/fixtures/config/project-template/common.yaml
new file mode 100644
index 0000000..9e76bde
--- /dev/null
+++ b/tests/fixtures/config/project-template/common.yaml
@@ -0,0 +1,56 @@
+pipelines:
+ - name: check
+ manager: independent
+ source:
+ gerrit
+ trigger:
+ gerrit:
+ - event: patchset-created
+ success:
+ gerrit:
+ verified: 1
+ failure:
+ gerrit:
+ verified: -1
+
+ - 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
+
+jobs:
+ - name:
+ project-test1
+ - name:
+ project-test2
+
+project-templates:
+ - name: test-template
+ gate:
+ jobs:
+ - project-test2
+
+projects:
+ - name: org/project
+ templates:
+ - test-template
+ gate:
+ jobs:
+ - project-test1
diff --git a/tests/fixtures/config/project-template/main.yaml b/tests/fixtures/config/project-template/main.yaml
new file mode 100644
index 0000000..c89fdfa
--- /dev/null
+++ b/tests/fixtures/config/project-template/main.yaml
@@ -0,0 +1,4 @@
+tenants:
+ - name: tenant-one
+ include:
+ - common.yaml
diff --git a/tests/fixtures/config/project-template/tenant-one.yaml b/tests/fixtures/config/project-template/tenant-one.yaml
new file mode 100644
index 0000000..c9096ef
--- /dev/null
+++ b/tests/fixtures/config/project-template/tenant-one.yaml
@@ -0,0 +1,33 @@
+pipelines:
+ - name: tenant-one-gate
+ manager: dependent
+ success-message: Build succeeded (tenant-one-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
+
+jobs:
+ - name:
+ project1-test1
+
+projects:
+ - name: org/project1
+ check:
+ - project1-test1
+ tenant-one-gate:
+ - project1-test1
diff --git a/tests/fixtures/config/project-template/zuul.conf b/tests/fixtures/config/project-template/zuul.conf
new file mode 100644
index 0000000..67f3d2c
--- /dev/null
+++ b/tests/fixtures/config/project-template/zuul.conf
@@ -0,0 +1,36 @@
+[gearman]
+server=127.0.0.1
+
+[zuul]
+tenant_config=config/project-template/main.yaml
+url_pattern=http://logs.example.com/{change.number}/{change.patchset}/{pipeline.name}/{job.name}/{build.number}
+job_name_in_report=true
+
+[merger]
+git_dir=/tmp/zuul-test/git
+git_user_email=zuul@example.com
+git_user_name=zuul
+zuul_url=http://zuul.example.com/p
+
+[swift]
+authurl=https://identity.api.example.org/v2.0/
+user=username
+key=password
+tenant_name=" "
+
+default_container=logs
+region_name=EXP
+logserver_prefix=http://logs.example.org/server.app/
+
+[connection gerrit]
+driver=gerrit
+server=review.example.com
+user=jenkins
+sshkey=none
+
+[connection smtp]
+driver=smtp
+server=localhost
+port=25
+default_from=zuul@example.com
+default_to=you@example.com