summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2019-07-15 16:54:35 +0000
committerGerrit Code Review <review@openstack.org>2019-07-15 16:54:35 +0000
commitb0d0bad271bf598d9d22c5054c856f90df369e1b (patch)
treeedddad91b27877914e89560ded3f42544e5d9aa7 /tests
parent775499547496777752fb606ac7121b44c6b1f2d9 (diff)
parenta9e12ed4a9f5866da0af5fdc68f60b09ca8efa4b (diff)
downloadpython-jenkins-job-builder-b0d0bad271bf598d9d22c5054c856f90df369e1b.tar.gz
python-jenkins-job-builder-b0d0bad271bf598d9d22c5054c856f90df369e1b.tar.xz
python-jenkins-job-builder-b0d0bad271bf598d9d22c5054c856f90df369e1b.zip
Merge "Add support for rendering jinja template as yaml"
Diffstat (limited to 'tests')
-rw-r--r--tests/yamlparser/fixtures/jinja-as-yaml-include01.xml31
-rw-r--r--tests/yamlparser/fixtures/jinja-as-yaml-include01.yaml7
-rw-r--r--tests/yamlparser/fixtures/jinja-as-yaml-include01.yaml.inc3
3 files changed, 41 insertions, 0 deletions
diff --git a/tests/yamlparser/fixtures/jinja-as-yaml-include01.xml b/tests/yamlparser/fixtures/jinja-as-yaml-include01.xml
new file mode 100644
index 00000000..732bb2c4
--- /dev/null
+++ b/tests/yamlparser/fixtures/jinja-as-yaml-include01.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<project>
+ <actions/>
+ <description>&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
+ <keepDependencies>false</keepDependencies>
+ <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
+ <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
+ <concurrentBuild>false</concurrentBuild>
+ <canRoam>true</canRoam>
+ <properties>
+ <hudson.model.ParametersDefinitionProperty>
+ <parameterDefinitions>
+ <hudson.model.ChoiceParameterDefinition>
+ <name>TEST_CHOICE</name>
+ <description/>
+ <choices class="java.util.Arrays$ArrayList">
+ <a class="string-array">
+ <string>a</string>
+ <string>b</string>
+ <string>c</string>
+ </a>
+ </choices>
+ </hudson.model.ChoiceParameterDefinition>
+ </parameterDefinitions>
+ </hudson.model.ParametersDefinitionProperty>
+ </properties>
+ <scm class="hudson.scm.NullSCM"/>
+ <builders/>
+ <publishers/>
+ <buildWrappers/>
+</project>
diff --git a/tests/yamlparser/fixtures/jinja-as-yaml-include01.yaml b/tests/yamlparser/fixtures/jinja-as-yaml-include01.yaml
new file mode 100644
index 00000000..2ea430f0
--- /dev/null
+++ b/tests/yamlparser/fixtures/jinja-as-yaml-include01.yaml
@@ -0,0 +1,7 @@
+- job:
+ name: test-job-as-yaml
+ parameters:
+ - choice:
+ name: TEST_CHOICE
+ choices:
+ !include-jinja2-as-yaml: jinja-as-yaml-include01.yaml.inc
diff --git a/tests/yamlparser/fixtures/jinja-as-yaml-include01.yaml.inc b/tests/yamlparser/fixtures/jinja-as-yaml-include01.yaml.inc
new file mode 100644
index 00000000..c1c3c8b3
--- /dev/null
+++ b/tests/yamlparser/fixtures/jinja-as-yaml-include01.yaml.inc
@@ -0,0 +1,3 @@
+{% for item in ['a', 'b', 'c'] %}
+- {{ item }}
+{% endfor -%}