Tests: Add regression tests for stories fixed by parser rewrite
Change-Id: I0e6ac97c4c97a762cc7483393d6f85af4e902aa7
This commit is contained in:
parent
c011568aa0
commit
b2ef49cd9f
1
tests/yamlparser/job_fixtures/regression-2010428.inc.j2
Normal file
1
tests/yamlparser/job_fixtures/regression-2010428.inc.j2
Normal file
@ -0,0 +1 @@
|
||||
some builder
|
13
tests/yamlparser/job_fixtures/regression-2010428.xml
Normal file
13
tests/yamlparser/job_fixtures/regression-2010428.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<flow-definition plugin="workflow-job">
|
||||
<definition class="org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition" plugin="workflow-cps">
|
||||
<script>some builder</script>
|
||||
<sandbox>false</sandbox>
|
||||
</definition>
|
||||
<actions/>
|
||||
<description><!-- Managed by Jenkins Job Builder --></description>
|
||||
<keepDependencies>false</keepDependencies>
|
||||
<properties>
|
||||
<org.jenkinsci.plugins.workflow.job.properties.DisableConcurrentBuildsJobProperty/>
|
||||
</properties>
|
||||
</flow-definition>
|
8
tests/yamlparser/job_fixtures/regression-2010428.yaml
Normal file
8
tests/yamlparser/job_fixtures/regression-2010428.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
# https://storyboard.openstack.org/#!/story/2010428
|
||||
# Bug: TypeError: argument of type 'Jinja2Loader' is not iterable
|
||||
|
||||
- job:
|
||||
name: test
|
||||
project-type: pipeline
|
||||
|
||||
dsl: !include-jinja2: regression-2010428.inc.j2
|
32
tests/yamlparser/job_fixtures/regression-2010535.xml
Normal file
32
tests/yamlparser/job_fixtures/regression-2010535.xml
Normal file
@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<actions/>
|
||||
<description><!-- Managed by Jenkins Job Builder --></description>
|
||||
<keepDependencies>false</keepDependencies>
|
||||
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
||||
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
||||
<concurrentBuild>false</concurrentBuild>
|
||||
<canRoam>true</canRoam>
|
||||
<properties>
|
||||
<hudson.model.ParametersDefinitionProperty>
|
||||
<parameterDefinitions>
|
||||
<hudson.model.StringParameterDefinition>
|
||||
<name>PARAM_1</name>
|
||||
<description/>
|
||||
<defaultValue>{default|my_default}</defaultValue>
|
||||
<trim>false</trim>
|
||||
</hudson.model.StringParameterDefinition>
|
||||
<hudson.model.StringParameterDefinition>
|
||||
<name>PARAM_2</name>
|
||||
<description/>
|
||||
<defaultValue>my_default</defaultValue>
|
||||
<trim>false</trim>
|
||||
</hudson.model.StringParameterDefinition>
|
||||
</parameterDefinitions>
|
||||
</hudson.model.ParametersDefinitionProperty>
|
||||
</properties>
|
||||
<scm class="hudson.scm.NullSCM"/>
|
||||
<builders/>
|
||||
<publishers/>
|
||||
<buildWrappers/>
|
||||
</project>
|
32
tests/yamlparser/job_fixtures/regression-2010535.yaml
Normal file
32
tests/yamlparser/job_fixtures/regression-2010535.yaml
Normal file
@ -0,0 +1,32 @@
|
||||
# https://storyboard.openstack.org/#!/story/2010535
|
||||
# Bug: JJB doesn't expand macro in case of usage without arguments
|
||||
# String templates in macro calls without parameters are NOT expanded.
|
||||
# Jinja2 templates in macro calls without parameters ARE expanded.
|
||||
|
||||
- parameter:
|
||||
name: p_PARAM_1
|
||||
parameters:
|
||||
- string:
|
||||
name: PARAM_1
|
||||
# Not expanded:
|
||||
default: '{default|my_default}'
|
||||
|
||||
- parameter:
|
||||
name: p_PARAM_2
|
||||
parameters:
|
||||
- string:
|
||||
name: PARAM_2
|
||||
# Expanded to default value:
|
||||
default: !j2: '{{ default | default("my_default") }}'
|
||||
|
||||
# job definition
|
||||
- job-template:
|
||||
name: sample-job
|
||||
parameters:
|
||||
- p_PARAM_1
|
||||
- p_PARAM_2
|
||||
|
||||
- project:
|
||||
name: sample-project
|
||||
jobs:
|
||||
- sample-job
|
Loading…
Reference in New Issue
Block a user