Tests: Add tests for including a list of files

There were no tests for !include: and !include-jinja2: with a list of
files.

Change-Id: Id786e0306ec0279e98ac3b3cb7da62e688bcb12e
This commit is contained in:
Vsevolod Fedorov 2023-02-13 11:15:02 +03:00
parent a4052b1388
commit 8784d916a6
6 changed files with 71 additions and 0 deletions

View File

@ -0,0 +1,20 @@
<?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 include-1
echo include-2 echo var=12345</command>
</hudson.tasks.Shell>
</builders>
<publishers/>
<buildWrappers/>
</project>

View File

@ -0,0 +1,14 @@
# Check including a list of files, with variable expansion.
- job-template:
name: sample-job
var: 12345
builders:
- shell: !include:
- include002-list.yaml.shell-1
- include002-list.yaml.shell-2
- project:
name: sample-project
jobs:
- sample-job

View File

@ -0,0 +1 @@
echo include-1

View File

@ -0,0 +1,2 @@
echo include-2
echo var={var}

View File

@ -0,0 +1,22 @@
<?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>
1
2
3</command>
</hudson.tasks.Shell>
</builders>
<publishers/>
<buildWrappers/>
</project>

View File

@ -0,0 +1,12 @@
# Check jinja-including a list of files.
- job-template:
name: sample-job
builders:
- shell: !include-jinja2:
- jinja03.yaml.inc
- project:
name: sample-project
jobs:
- sample-job