Tests: Add tests for using tags in parameter definition

Change-Id: Ib9a6c567c50f37643a498c879b82d05d1c7a856e
This commit is contained in:
Vsevolod Fedorov 2023-02-20 12:06:28 +03:00
parent de86b2c130
commit e9fb7c70a1
14 changed files with 176 additions and 0 deletions

View File

@ -0,0 +1 @@
some description

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<actions/>
<description>some 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/>
<scm class="hudson.scm.NullSCM"/>
<builders/>
<publishers/>
<buildWrappers/>
</project>

View File

@ -0,0 +1,18 @@
# https://storyboard.openstack.org/#!/story/2007227
# with Python 3 there is TypeError when include-raw with property replacement is used in defaults
- defaults:
name: 'test-defaults'
prop: 'regression-2007227.description'
description: !include-raw:
- '{prop}.html'
- project:
name: 'test-project'
jobs:
- 'test-job'
- job-template:
id: 'test-job'
name: '{id}'
defaults: 'test-defaults'

View File

@ -0,0 +1 @@
variable contents

View File

@ -0,0 +1,21 @@
<?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/>
<scm class="hudson.scm.NullSCM"/>
<builders>
<hudson.tasks.Shell>
<command>echo variable contents
</command>
</hudson.tasks.Shell>
</builders>
<publishers/>
<buildWrappers/>
</project>

View File

@ -0,0 +1,13 @@
# !include-raw-escape: tag in a variable.
- job-template:
name: sample-job
var: !include-raw-escape: tag_in_parameter-include-raw-escape.inc.txt
builders:
- shell: |
echo {var}
- project:
name: sample-project
jobs:
- sample-job

View File

@ -0,0 +1 @@
variable contents

View File

@ -0,0 +1,21 @@
<?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/>
<scm class="hudson.scm.NullSCM"/>
<builders>
<hudson.tasks.Shell>
<command>echo variable contents
</command>
</hudson.tasks.Shell>
</builders>
<publishers/>
<buildWrappers/>
</project>

View File

@ -0,0 +1,13 @@
# !include-raw: tag in a variable.
- job-template:
name: sample-job
var: !include-raw: tag_in_parameter-include-raw.inc.txt
builders:
- shell: |
echo {var}
- project:
name: sample-project
jobs:
- sample-job

View File

@ -0,0 +1 @@
variable contents

View File

@ -0,0 +1,21 @@
<?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/>
<scm class="hudson.scm.NullSCM"/>
<builders>
<hudson.tasks.Shell>
<command>echo variable contents
</command>
</hudson.tasks.Shell>
</builders>
<publishers/>
<buildWrappers/>
</project>

View File

@ -0,0 +1,13 @@
# !include: tag in a variable.
- job-template:
name: sample-job
var: !include: tag_in_parameter-include.inc
builders:
- shell: |
echo {var}
- project:
name: sample-project
jobs:
- sample-job

View File

@ -0,0 +1,21 @@
<?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/>
<scm class="hudson.scm.NullSCM"/>
<builders>
<hudson.tasks.Shell>
<command>echo some variable
</command>
</hudson.tasks.Shell>
</builders>
<publishers/>
<buildWrappers/>
</project>

View File

@ -0,0 +1,15 @@
# !j2: tag in a variable.
- job-template:
name: sample-job
var: !join:
- ' '
- [some, variable]
builders:
- shell: |
echo {var}
- project:
name: sample-project
jobs:
- sample-job