Yaml parser tests: Add tests for views expansion

Currently, views handling part in YamlParser class is not covered at all.

Change-Id: Ifaac0c44b0a0487e5673060d7b1f25393161f750
This commit is contained in:
Vsevolod Fedorov 2022-08-10 10:38:11 +03:00
parent 28d00a0e28
commit 60b9c23d33
32 changed files with 785 additions and 1 deletions

View File

@ -16,7 +16,7 @@ from jenkins_jobs.modules import project_multibranch
from jenkins_jobs.modules import project_multijob
from jenkins_jobs.parser import YamlParser
from jenkins_jobs.registry import ModuleRegistry
from jenkins_jobs.xml_config import XmlJob, XmlJobGenerator
from jenkins_jobs.xml_config import XmlJob, XmlJobGenerator, XmlViewGenerator
import jenkins_jobs.local_yaml as yaml
@ -167,3 +167,28 @@ def check_job(scenario, expected_output, jjb_config, registry):
assert stripped_expected_output == pretty_xml
return check
@pytest.fixture
def check_view(scenario, expected_output, jjb_config, registry):
parser = YamlParser(jjb_config)
def check():
parser.parse(str(scenario.in_path))
registry.set_parser_data(parser.data)
job_data_list, view_data_list = parser.expandYaml(registry)
generator = XmlViewGenerator(registry)
view_xml_list = generator.generateXML(view_data_list)
view_xml_list.sort(key=AlphanumSort)
pretty_xml = (
"\n".join(view.output().decode() for view in view_xml_list)
.strip()
.replace("\n\n", "\n")
)
stripped_expected_output = (
expected_output.strip().replace("<BLANKLINE>", "").replace("\n\n", "\n")
)
assert stripped_expected_output == pretty_xml
return check

View File

@ -0,0 +1,21 @@
from operator import attrgetter
from pathlib import Path
import pytest
from tests.enum_scenarios import scenario_list
fixtures_dir = Path(__file__).parent / "view_fixtures"
@pytest.fixture(
params=scenario_list(fixtures_dir),
ids=attrgetter("name"),
)
def scenario(request):
return request.param
def test_yaml_snippet(check_view):
check_view()

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.AllView>
<name>add_managed_to_desc</name>
<description>My nice description&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
</hudson.model.AllView>

View File

@ -0,0 +1,9 @@
- project:
name: add_managed_to_desc
views:
- 'add_managed_to_desc'
- view-template:
name: add_managed_to_desc
description: 'My nice description'
view-type: all

View File

@ -0,0 +1,2 @@
[job_builder]
keep_descriptions = True

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.AllView>
<name>dont_overwrite_desc</name>
<description/>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
</hudson.model.AllView>

View File

@ -0,0 +1,8 @@
- project:
name: dont_overwrite_desc
views:
- dont_overwrite_desc
- view-template:
name: dont_overwrite_desc
view-type: all

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.AllView>
<name>All</name>
<description>&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
</hudson.model.AllView>

View File

@ -0,0 +1,3 @@
- view:
name: All
view-type: all

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>list-minimal</name>
<description>description&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
<jenkins.plugins.extracolumns.BuildParametersColumn plugin="extra-columns">
<singlePara>true</singlePara>
<parameterName>MY_PARAMETER</parameterName>
</jenkins.plugins.extracolumns.BuildParametersColumn>
</columns>
<includeRegex>(?!test.*).*</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>

View File

@ -0,0 +1,20 @@
- defaults:
name: my-defaults
view_regex: (?!test.*).*
my_columns:
- status
- weather
- extra-build-parameter: MY_PARAMETER
- view-template:
name: list-minimal
defaults: my-defaults
view-type: list
description: 'description'
columns: '{my_columns}'
regex: '{view_regex}'
- project:
name: test-project
views:
- list-minimal

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>my-view-1-11</name>
<description>View N 1.11&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
</columns>
<includeRegex>1.11</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>my-view-2-11</name>
<description>View N 2.11&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
</columns>
<includeRegex>2.11</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>my-view-2-22</name>
<description>View N 2.22&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
</columns>
<includeRegex>2.22</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>

View File

@ -0,0 +1,19 @@
- view-template:
name: my-view-{major}-{minor}
view-type: list
description: 'View N {major}.{minor}'
columns:
- status
- weather
regex: '{major}.{minor}'
- project:
name: test-project
major: [1, 2, 3]
minor: [11, 22]
exclude:
- major: 1
minor: 22
- major: 3
views:
- my-view-{major}-{minor}

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>my-view-1</name>
<description>View N1&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
</columns>
<includeRegex>(?!test.*).*</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>my-view-2</name>
<description>View N2&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
</columns>
<includeRegex>(?!test.*).*</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>my-view-3</name>
<description>View N3&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
</columns>
<includeRegex>regex-for-view-3</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>

View File

@ -0,0 +1,19 @@
- view-template:
name: my-view-{num}
view-type: list
description: 'View N{num}'
columns:
- status
- weather
regex: '{my_regex}'
- project:
name: test-project
my_regex: '(?!test.*).*'
num:
- 1
- 2
- 3:
my_regex: regex-for-view-3
views:
- my-view-{num}

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>list-minimal</name>
<description>description&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
<jenkins.plugins.extracolumns.BuildParametersColumn plugin="extra-columns">
<singlePara>true</singlePara>
<parameterName>MY_PARAMETER</parameterName>
</jenkins.plugins.extracolumns.BuildParametersColumn>
</columns>
<includeRegex>(?!test.*).*</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>

View File

@ -0,0 +1,19 @@
- defaults:
name: global
view_regex: (?!test.*).*
my_columns:
- status
- weather
- extra-build-parameter: MY_PARAMETER
- view-template:
name: list-minimal
view-type: list
description: 'description'
columns: '{my_columns}'
regex: '{view_regex}'
- project:
name: test-project
views:
- list-minimal

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>my-view-1</name>
<description>View N1&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
<jenkins.plugins.extracolumns.BuildParametersColumn plugin="extra-columns">
<singlePara>true</singlePara>
<parameterName>MY_PARAMETER</parameterName>
</jenkins.plugins.extracolumns.BuildParametersColumn>
</columns>
<includeRegex>(?!test.*).*</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>my-view-2</name>
<description>View N2&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
<jenkins.plugins.extracolumns.BuildParametersColumn plugin="extra-columns">
<singlePara>true</singlePara>
<parameterName>MY_PARAMETER</parameterName>
</jenkins.plugins.extracolumns.BuildParametersColumn>
</columns>
<includeRegex>(?!test.*).*</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>my-view-3</name>
<description>View N3&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
<jenkins.plugins.extracolumns.BuildParametersColumn plugin="extra-columns">
<singlePara>true</singlePara>
<parameterName>MY_PARAMETER</parameterName>
</jenkins.plugins.extracolumns.BuildParametersColumn>
</columns>
<includeRegex>(?!test.*).*</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>

View File

@ -0,0 +1,24 @@
- view-template:
name: my-view-{num}
view-type: list
description: 'View N{num}'
columns:
- status
- weather
- extra-build-parameter: MY_PARAMETER
regex: (?!test.*).*
- view-group:
name: my-view-group
views:
- my-view-{num}
- my-view-{num}:
num: 3
- project:
name: test-project
views:
- my-view-{num}:
num: 1
- my-view-group:
num: 2

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>list-minimal</name>
<description>description&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
<jenkins.plugins.extracolumns.BuildParametersColumn plugin="extra-columns">
<singlePara>true</singlePara>
<parameterName>MY_PARAMETER</parameterName>
</jenkins.plugins.extracolumns.BuildParametersColumn>
</columns>
<includeRegex>(?!test.*).*</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>

View File

@ -0,0 +1,14 @@
- view:
name: list-minimal
view-type: list
description: 'description'
columns:
- status
- weather
- extra-build-parameter: MY_PARAMETER
regex: (?!test.*).*
- project:
name: test-project
views:
- list-minimal

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>my-view-1</name>
<description>View N1&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
<jenkins.plugins.extracolumns.BuildParametersColumn plugin="extra-columns">
<singlePara>true</singlePara>
<parameterName>MY_PARAMETER</parameterName>
</jenkins.plugins.extracolumns.BuildParametersColumn>
</columns>
<includeRegex>(?!test.*).*</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>my-view-2</name>
<description>View N2&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
<jenkins.plugins.extracolumns.BuildParametersColumn plugin="extra-columns">
<singlePara>true</singlePara>
<parameterName>MY_PARAMETER</parameterName>
</jenkins.plugins.extracolumns.BuildParametersColumn>
</columns>
<includeRegex>(?!test.*).*</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>my-view-3</name>
<description>View N3&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
<jenkins.plugins.extracolumns.BuildParametersColumn plugin="extra-columns">
<singlePara>true</singlePara>
<parameterName>MY_PARAMETER</parameterName>
</jenkins.plugins.extracolumns.BuildParametersColumn>
</columns>
<includeRegex>(?!test.*).*</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>

View File

@ -0,0 +1,25 @@
# Check with None as parameters value instead of dict.
- view-template:
name: my-view-{num}
view-type: list
description: 'View N{num}'
columns:
- status
- weather
- extra-build-parameter: MY_PARAMETER
regex: (?!test.*).*
- view-group:
name: my-view-group
views:
- my-view-{num}:
- my-view-{num}:
num: 3
- project:
name: test-project
num: 1
views:
- my-view-{num}:
- my-view-group:
num: 2

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>my-view-1</name>
<description>View N1&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
</columns>
<includeRegex>1-project 2-view-param 3-project 4-template 5-defaults</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>my-view-2</name>
<description>View N2&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
</columns>
<includeRegex>1-project 2-group-param 3-group-param 4-template 5-defaults</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>my-view-3</name>
<description>View N3&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
</columns>
<includeRegex>1-project 2-group-param 3-group 4-template 5-defaults</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>

View File

@ -0,0 +1,42 @@
- defaults:
name: global
param_1: '1-defaults'
param_2: '2-defaults'
param_3: '3-defaults'
param_4: '4-defaults'
param_5: '5-defaults' # Should be used.
- view-template:
name: my-view-{num}
view-type: list
param_1: '1-template'
param_2: '2-template'
param_3: '3-template'
param_4: '4-template' # Should be used.
description: 'View N{num}'
columns:
- status
- weather
regex: '{param_1} {param_2} {param_3} {param_4} {param_5}'
- view-group:
name: my-view-group
views:
- my-view-{num}:
num: 2
- my-view-{num}:
num: 3
param_3: '3-group' # Should be used.
- project:
name: test-project
param_1: '1-project' # Should be used.
param_2: '2-project'
param_3: '3-project'
views:
- my-view-{num}:
num: 1
param_2: '2-view-param' # Should be used.
- my-view-group:
param_2: '2-group-param' # Should be used.
param_3: '3-group-param'

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>not-as-simple-template-test-ids-2-canary</name>
<description>&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
<jenkins.plugins.extracolumns.BuildParametersColumn plugin="extra-columns">
<singlePara>true</singlePara>
<parameterName>MY_PARAMETER</parameterName>
</jenkins.plugins.extracolumns.BuildParametersColumn>
</columns>
<includeRegex>not-as-simple-template-test-ids-{num}-{type} Goodbye World 2 canary</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>simple-template-test-ids-1-periodic</name>
<description>&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
<jenkins.plugins.extracolumns.BuildParametersColumn plugin="extra-columns">
<singlePara>true</singlePara>
<parameterName>MY_PARAMETER</parameterName>
</jenkins.plugins.extracolumns.BuildParametersColumn>
</columns>
<includeRegex>simple-template-test-ids-{num}-{type} Hello World 1 periodic</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>

View File

@ -0,0 +1,31 @@
- project:
name: test_template_id
views:
- simple-template:
test_var: Hello World
type: periodic
num: 1
- not-as-simple-template:
test_var: Goodbye World
type: canary
num: 2
- view-template:
name: 'simple-template-test-ids-{num}-{type}'
id: simple-template
view-type: list
columns:
- status
- weather
- extra-build-parameter: MY_PARAMETER
regex: '{template-name} {test_var} {num} {type}'
- view-template:
name: 'not-as-simple-template-test-ids-{num}-{type}'
id: not-as-simple-template
view-type: list
columns:
- status
- weather
- extra-build-parameter: MY_PARAMETER
regex: '{template-name} {test_var} {num} {type}'

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>list-minimal</name>
<description>description&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
<jenkins.plugins.extracolumns.BuildParametersColumn plugin="extra-columns">
<singlePara>true</singlePara>
<parameterName>MY_PARAMETER</parameterName>
</jenkins.plugins.extracolumns.BuildParametersColumn>
</columns>
<includeRegex>(?!test.*).*</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>

View File

@ -0,0 +1,16 @@
- view-template:
name: list-minimal
view-type: list
description: 'description'
columns: '{columns}'
regex: '{regex}'
- project:
name: test-project
columns:
- status
- weather
- extra-build-parameter: MY_PARAMETER
views:
- list-minimal:
regex: (?!test.*).*

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<hudson.model.ListView>
<name>list-minimal</name>
<description>description&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
<jobNames>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</jobNames>
<jobFilters/>
<columns>
<hudson.views.StatusColumn/>
<hudson.views.WeatherColumn/>
<jenkins.plugins.extracolumns.BuildParametersColumn plugin="extra-columns">
<singlePara>true</singlePara>
<parameterName>MY_PARAMETER</parameterName>
</jenkins.plugins.extracolumns.BuildParametersColumn>
</columns>
<includeRegex>(?!test.*).*</includeRegex>
<recurse>false</recurse>
</hudson.model.ListView>

View File

@ -0,0 +1,15 @@
- view-template:
name: list-minimal
view-type: list
description: 'description'
columns: '{columns}'
regex: (?!test.*).*
- project:
name: test-project
columns:
- status
- weather
- extra-build-parameter: MY_PARAMETER
views:
- list-minimal