summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEren ATAS <eatas.contractor@libertyglobal.com>2020-06-25 15:08:04 +0200
committerEren ATAS <eatas.contractor@libertyglobal.com>2020-07-07 11:32:51 +0200
commit2e84bdf5b61743759d0d1ba5a5e85dda29bf58bf (patch)
tree1b8c95847f6f49bf80449e203b77cc52b32f1f8c
parent28e43831e9facb5bdd1169f3af845aad5bf0c717 (diff)
downloadpython-jenkins-job-builder-2e84bdf5b61743759d0d1ba5a5e85dda29bf58bf.tar.gz
python-jenkins-job-builder-2e84bdf5b61743759d0d1ba5a5e85dda29bf58bf.tar.xz
python-jenkins-job-builder-2e84bdf5b61743759d0d1ba5a5e85dda29bf58bf.zip
Removed the unnecessary empty combinationFilter Tag
In the current implementation, jjb creates an empty combinationFilter tag whenever there is `executionStrategy`. This empty tag should not appear. Change-Id: I2bf25ae58d12904ce0a00e0a5cfefbf27d9451ad Signed-off-by: Eren ATAS <eatas.contractor@libertyglobal.com>
-rw-r--r--jenkins_jobs/modules/project_matrix.py7
-rw-r--r--tests/cmd/fixtures/multi-path/output_recursive/job41
-rw-r--r--tests/general/fixtures/custom-workspace002.xml1
-rw-r--r--tests/general/fixtures/matrix-axis-yaml.xml1
-rw-r--r--tests/general/fixtures/matrix-axis001.xml1
-rw-r--r--tests/general/fixtures/matrix-axis002.xml1
-rw-r--r--tests/general/fixtures/matrix-axis003.xml1
-rw-r--r--tests/general/fixtures/matrix-axis004.xml1
-rw-r--r--tests/general/fixtures/matrix-axis005.xml1
-rw-r--r--tests/general/fixtures/project-type002.xml1
-rw-r--r--tests/wrappers/fixtures/matrix-tie-parent.xml1
-rw-r--r--tests/yamlparser/fixtures/custom_distri.xml1
-rw-r--r--tests/yamlparser/fixtures/expand-yaml-for-template-job/dimensionality-test001.xml3
-rw-r--r--tests/yamlparser/fixtures/project-matrix002.xml1
-rw-r--r--tests/yamlparser/fixtures/trigger_parameterized_builds/parameter-override-ordering-003.xml2
15 files changed, 4 insertions, 20 deletions
diff --git a/jenkins_jobs/modules/project_matrix.py b/jenkins_jobs/modules/project_matrix.py
index ebd566f5..01bc431d 100644
--- a/jenkins_jobs/modules/project_matrix.py
+++ b/jenkins_jobs/modules/project_matrix.py
@@ -162,9 +162,10 @@ class Matrix(jenkins_jobs.modules.base.Base):
strategy = data.get(strategy_name, {})
if strategy_name == "execution-strategy":
- XML.SubElement(root, "combinationFilter").text = str(
- strategy.get("combination-filter", "")
- ).rstrip()
+ if "combination-filter" in strategy:
+ XML.SubElement(root, "combinationFilter").text = str(
+ strategy.get("combination-filter", "")
+ ).rstrip()
XML.SubElement(ex_r, "runSequentially").text = str(
strategy.get("sequential", False)
).lower()
diff --git a/tests/cmd/fixtures/multi-path/output_recursive/job4 b/tests/cmd/fixtures/multi-path/output_recursive/job4
index dd47f962..20f4d7fc 100644
--- a/tests/cmd/fixtures/multi-path/output_recursive/job4
+++ b/tests/cmd/fixtures/multi-path/output_recursive/job4
@@ -3,7 +3,6 @@
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>false</runSequentially>
</executionStrategy>
- <combinationFilter/>
<axes/>
<actions/>
<description>&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
diff --git a/tests/general/fixtures/custom-workspace002.xml b/tests/general/fixtures/custom-workspace002.xml
index a3a266b6..3535e187 100644
--- a/tests/general/fixtures/custom-workspace002.xml
+++ b/tests/general/fixtures/custom-workspace002.xml
@@ -3,7 +3,6 @@
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>false</runSequentially>
</executionStrategy>
- <combinationFilter/>
<axes/>
<actions/>
<keepDependencies>false</keepDependencies>
diff --git a/tests/general/fixtures/matrix-axis-yaml.xml b/tests/general/fixtures/matrix-axis-yaml.xml
index 33724b97..02ef44a0 100644
--- a/tests/general/fixtures/matrix-axis-yaml.xml
+++ b/tests/general/fixtures/matrix-axis-yaml.xml
@@ -3,7 +3,6 @@
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>false</runSequentially>
</executionStrategy>
- <combinationFilter/>
<axes>
<org.jenkinsci.plugins.yamlaxis.YamlAxis>
<name>python</name>
diff --git a/tests/general/fixtures/matrix-axis001.xml b/tests/general/fixtures/matrix-axis001.xml
index da2c6c0d..25929b6b 100644
--- a/tests/general/fixtures/matrix-axis001.xml
+++ b/tests/general/fixtures/matrix-axis001.xml
@@ -3,7 +3,6 @@
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>false</runSequentially>
</executionStrategy>
- <combinationFilter/>
<axes>
<ca.silvermaplesolutions.jenkins.plugins.daxis.DynamicAxis>
<name>config</name>
diff --git a/tests/general/fixtures/matrix-axis002.xml b/tests/general/fixtures/matrix-axis002.xml
index fa00869b..1f6363bf 100644
--- a/tests/general/fixtures/matrix-axis002.xml
+++ b/tests/general/fixtures/matrix-axis002.xml
@@ -3,7 +3,6 @@
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>false</runSequentially>
</executionStrategy>
- <combinationFilter/>
<axes>
<ca.silvermaplesolutions.jenkins.plugins.daxis.DynamicAxis>
<name>config</name>
diff --git a/tests/general/fixtures/matrix-axis003.xml b/tests/general/fixtures/matrix-axis003.xml
index 538337cc..1541278d 100644
--- a/tests/general/fixtures/matrix-axis003.xml
+++ b/tests/general/fixtures/matrix-axis003.xml
@@ -3,7 +3,6 @@
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>false</runSequentially>
</executionStrategy>
- <combinationFilter/>
<axes>
<jenkins.plugins.shiningpanda.matrix.PythonAxis>
<name>PYTHON</name>
diff --git a/tests/general/fixtures/matrix-axis004.xml b/tests/general/fixtures/matrix-axis004.xml
index 1c055910..ce276723 100644
--- a/tests/general/fixtures/matrix-axis004.xml
+++ b/tests/general/fixtures/matrix-axis004.xml
@@ -3,7 +3,6 @@
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>false</runSequentially>
</executionStrategy>
- <combinationFilter/>
<axes>
<hudson.matrix.JDKAxis>
<name>jdk</name>
diff --git a/tests/general/fixtures/matrix-axis005.xml b/tests/general/fixtures/matrix-axis005.xml
index 69122611..753e4d10 100644
--- a/tests/general/fixtures/matrix-axis005.xml
+++ b/tests/general/fixtures/matrix-axis005.xml
@@ -3,7 +3,6 @@
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>false</runSequentially>
</executionStrategy>
- <combinationFilter/>
<axes>
<ca.silvermaplesolutions.jenkins.plugins.daxis.DynamicAxis>
<name>config</name>
diff --git a/tests/general/fixtures/project-type002.xml b/tests/general/fixtures/project-type002.xml
index ede8bc0a..ae27ec89 100644
--- a/tests/general/fixtures/project-type002.xml
+++ b/tests/general/fixtures/project-type002.xml
@@ -3,7 +3,6 @@
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>false</runSequentially>
</executionStrategy>
- <combinationFilter/>
<axes/>
<actions/>
<keepDependencies>false</keepDependencies>
diff --git a/tests/wrappers/fixtures/matrix-tie-parent.xml b/tests/wrappers/fixtures/matrix-tie-parent.xml
index 9d2c65b8..f88d63b5 100644
--- a/tests/wrappers/fixtures/matrix-tie-parent.xml
+++ b/tests/wrappers/fixtures/matrix-tie-parent.xml
@@ -3,7 +3,6 @@
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>false</runSequentially>
</executionStrategy>
- <combinationFilter/>
<axes/>
<buildWrappers>
<matrixtieparent.BuildWrapperMtp>
diff --git a/tests/yamlparser/fixtures/custom_distri.xml b/tests/yamlparser/fixtures/custom_distri.xml
index a12900d8..cf9e6467 100644
--- a/tests/yamlparser/fixtures/custom_distri.xml
+++ b/tests/yamlparser/fixtures/custom_distri.xml
@@ -3,7 +3,6 @@
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>false</runSequentially>
</executionStrategy>
- <combinationFilter/>
<axes>
<hudson.matrix.TextAxis>
<name>distribution</name>
diff --git a/tests/yamlparser/fixtures/expand-yaml-for-template-job/dimensionality-test001.xml b/tests/yamlparser/fixtures/expand-yaml-for-template-job/dimensionality-test001.xml
index 8d582dba..0923b125 100644
--- a/tests/yamlparser/fixtures/expand-yaml-for-template-job/dimensionality-test001.xml
+++ b/tests/yamlparser/fixtures/expand-yaml-for-template-job/dimensionality-test001.xml
@@ -3,7 +3,6 @@
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>false</runSequentially>
</executionStrategy>
- <combinationFilter/>
<axes>
<hudson.matrix.TextAxis>
<name>PLATFORM</name>
@@ -32,7 +31,6 @@
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>false</runSequentially>
</executionStrategy>
- <combinationFilter/>
<axes>
<hudson.matrix.TextAxis>
<name>PLATFORM</name>
@@ -61,7 +59,6 @@
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>false</runSequentially>
</executionStrategy>
- <combinationFilter/>
<axes>
<hudson.matrix.TextAxis>
<name>PLATFORM</name>
diff --git a/tests/yamlparser/fixtures/project-matrix002.xml b/tests/yamlparser/fixtures/project-matrix002.xml
index a31faada..e9fe8630 100644
--- a/tests/yamlparser/fixtures/project-matrix002.xml
+++ b/tests/yamlparser/fixtures/project-matrix002.xml
@@ -9,7 +9,6 @@
<color>BLUE</color>
</touchStoneResultCondition>
</executionStrategy>
- <combinationFilter/>
<axes/>
<actions/>
<description>&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
diff --git a/tests/yamlparser/fixtures/trigger_parameterized_builds/parameter-override-ordering-003.xml b/tests/yamlparser/fixtures/trigger_parameterized_builds/parameter-override-ordering-003.xml
index f2bf89fa..18637ea3 100644
--- a/tests/yamlparser/fixtures/trigger_parameterized_builds/parameter-override-ordering-003.xml
+++ b/tests/yamlparser/fixtures/trigger_parameterized_builds/parameter-override-ordering-003.xml
@@ -3,7 +3,6 @@
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>false</runSequentially>
</executionStrategy>
- <combinationFilter/>
<axes>
<hudson.matrix.TextAxis>
<name>foo_bar</name>
@@ -45,7 +44,6 @@
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>false</runSequentially>
</executionStrategy>
- <combinationFilter/>
<axes>
<hudson.matrix.TextAxis>
<name>foo_bar</name>