Tests: Add regression tests for stories fixed by parser rewrite

Change-Id: I0e6ac97c4c97a762cc7483393d6f85af4e902aa7
This commit is contained in:
Vsevolod Fedorov 2023-02-17 13:00:00 +03:00
parent c011568aa0
commit b2ef49cd9f
5 changed files with 86 additions and 0 deletions

View File

@ -0,0 +1 @@
some builder

View 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>&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<keepDependencies>false</keepDependencies>
<properties>
<org.jenkinsci.plugins.workflow.job.properties.DisableConcurrentBuildsJobProperty/>
</properties>
</flow-definition>

View 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

View File

@ -0,0 +1,32 @@
<?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.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>

View 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