Folders was not actually tested by tests. Fix tests and add more tests.
Fix bug in code unearthed by now-working tests: defaults were not checked
for job folders.
Task: 49188
Change-Id: I922af7a28b0ec0c99ef3f8a17b3d5a9c10f2dce0
Pytest makes each scenario into individual selectable test.
To be able to run each scenario separately is very useful for development.
Change-Id: I4b1c990a1fd839ce327cd7faa27159a9b9632fed
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>
Please review the following patch containing the code changes in
the repo. This patch is a transition patch and is the auto-generated
output of the python-black tool.
Change-Id: I2d2de71da8a105fb62b561899ae78441ddab4032
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
settings-type parameter hides global-settings-type and makes it
impossible to use settings from the file and ConfigFileProvider at the
same time like:
maven:
settings-type: file
settings: mvn/settings.xml
global-settings-type: cfp
global-settings: test
Change-Id: Ieda05912ae8b28942d98150a51c92b2521f2b6bf
Signed-off-by: Mykola Nikishov <mn@mn.com.ua>
Preparatory move for adopting pre-commit hooks.
Shoudl only remove newlines and spaces at end of files.
Change-Id: Ia33679467c533722b9308f7e7b74be395c926428
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
auth-tokean as None type should exclude from the build job
valuable for reuseing jobs that sometime need auth and othertimes don't
Change-Id: I691e7dd4ff1af53efd9fac3363bce9d41038cf25
Allows specifying a folder attribute for each job generated, which in
turn is used when creating or uploading to place the job under the
requested folder.
The job name is expanded after defaults are applied, to support the
attribute being defined within a set of defaults applied to a number of
jobs.
This in turn allows for multiple jobs with the same basename to exist,
provided they are targeted at different folders.
Does not support creating the folders if they do not exist.
Change-Id: I8c2157c4c81087cc972a048d1b88d5f08ac65361
The plugin uses a different matrix execution strategy. I have refactored
the part of code assuming there is only one strategy. The previous one
is known as 'default' and this change is back compatible.
Drop an error whenever more than one strategy is used.
Support exclude rules from either a file or inlined YAML (note in the
later case the YAML will need to be a literal string).
Tweak axis type documentation to reference both built-in axes and ones
provided by additional plugins.
Include three different examples for Yaml Axis which would help end
users understand how to add support for exclusion and or specificy the
exclusion as inlined Yaml.
Change-Id: I18e0fc7cb525fba3b772bae10e81d8dfce7298cb
Refactor base test class inheritance to allow for BaseTest class to be
reused without needing to also import the TestCase class everywhere in
order to avoid having the common test function executed on base classes.
This makes it easier to build base testing classes and then simplifies
the subclassing of these for actual tests.
Change-Id: I89809e8082469f814f245db4a9ab7658aac8a405
Enable testing of project modules to receive plugin info and ensure
that versions of the Maven project plugin older than 2.0.1 continue to
receive the required XML setting.
Change-Id: I2669052d0ef31c0b766e9cde24c842136c172b6c
In the maven-plugin, its usage is deprecated since version
2.0.1 and later (back in october 2013), causing errors on
/administrativeMonitor/OldData/manage webpage.
Before deprecation, default value was already true. To support
the plugin before it was deprecated the best would be to have
it parametrizable
Change-Id: Ic049e961983e9d5b25c5a2b0d32be5b3f717e923
In CFP plugin version >=2.10.0 the JJB code completely breaks for Maven
settings due to the new support for freeform cfp id names. We can detect
a old style name simply by reading the starting of the name and setting
it to set settings_type=cfp to maintain support for the old versions of
this plugin. Otherwise the default settings_type will fall back to 'file'.
Users using cfp will now need to set 'settings-type: cfp' in their YAML
files if they need to pull in CFP settings. All other settings file
configuration will work as it did in the past.
Change-Id: I650d485de6ecc1d2ef8fad6580c0c315fadde168
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Very basic support for Yaml axis provided by the Yaml Axis Jenkins Plugin:
https://wiki.jenkins-ci.org/display/JENKINS/Yaml+Axis+Plugin
This patch does not support exclusion which is done in a following
change.
Change-Id: I7e39382425e53f5e1eb811d21810a72389acea2d
Capture logs to attach them on exceptions to simplify the debugging of
errors in tests when they occur.
Change-Id: I5c1b5c306aba37789a8d41eabf65e0ac628af838
On freestyle project, we can set custom workspace.
On matrix project, we can set custom workspace and child custom workspace.
It allows to specify the directory for sub-builds.
Change-Id: Icef3831174ff805e86f1ece84fef9a438f465691
Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Adding the ability to configure the following checkboxes -
* Incremental build - only build changed modules
* Disable automatic site documentation artifact archiving
* Disable automatic fingerprinting of consumed and produced artifacts
* Build modules in parallel
* Resolve Dependencies during Pom parsing
* Run Headless
* Process plugins during pom parsing
* Use custom workspace
Change-Id: Ie379e8812175a5b2dcb68546520994e9ce04d66a
If value is written in uppercase letters, Jenkins converts it to
lowercase the next time the job configuration is saved.
<hudson.matrix.JDKAxis>
<name>JDK</name>
is changed to:
<hudson.matrix.JDKAxis>
<name>jdk</name>
As a result build URLs will change:
http://host/job/matrix_build/JDK=Java-7/1/
to:
http://host/job/matrix_build/jdk=Java-7/2/
Change-Id: Ia3018327c6dbffb2bb828dcc494559e57a1b6ad8
Axis that selects available JDKs. JDK axis has the same XML
structure as other axes; only the element name changes.
The matrix project support was split out of core Jenkins into the
'Matrix Project Plugin', so update the docstring to mention that
this plugin is required.
Tested on Jenkins ver. 1.565.2 with Matrix Project Plugin 1.4.
Change-Id: I6b9d243810833bd3d31535439cc48768db5a6598
This patch adds some detection logic to the code to detect if the
settings file starts with:
org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig
or in the case of global-settings starts with:
org.jenkinsci.plugins.configfiles.maven.GlobalMavenSettingsConfig
If true, the module will configure for Config File Provider as the
settings files.
See:
https://wiki.jenkins-ci.org/display/JENKINS/Config+File+Provider+Plugin
Change-Id: Iecadfd6265100720d1d0b08d3cf57a510999f89d
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
This axis requires the dynamic axis plugin:
https://wiki.jenkins-ci.org/display/JENKINS/DynamicAxis+Plugin
All the dynamic axis plugin settings are in the core project:
<matrix-project>
<axes>
<ca.silvermaplesolutions.jenkins.plugins.daxis.DynamicAxis>
<name>config</name>
<values>
<string>config_list</string>
</values>
<varName>config_list</varName>
<axisValues>
<string>default</string>
</axisValues>
</ca.silvermaplesolutions.jenkins.plugins.daxis.DynamicAxis>
</axes>
The plugin sets 2 values: axis name and variable name.
The axisValue element is hardcoded to 'default' in the plugin, so we do
the same in Jenkins job builder.
The matrix project supports multiple axes configuration, including dynamic
axis.
Tests added for:
* dynamic axis (by itself)
* multiple axes (dynamic and user-defined axes)
Tested on Jenkins LTS (1.554.2) with both the plugin installed and not
installed. The plugin is properly ignored in the latter case.
Change-Id: I36310bc512fd873fec4bd5f42937689fd178536e
Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Allow custom settings & global-settings config files to be configured
for maven projects.
In addition, the previously defined empty nodes for these configurations
were misnamed and this corrects that as well.
This change also switches to using an included test as an example.
Change-Id: I9f832f498e358268b3896ead3a78462e408bdd9d
Signed-off-by: Andrew Grimberg <grimbeaj@gmail.com>
The values map to these GUI choices
* default -> Default
* local-to-executor -> Local to the executor
* local-to-workspace -> Local to the workspace
This is on the project level what the similar option is on the builder
level.
Change-Id: I90ee3385ee12a46b5ab1eb26e3af1bdbfc36946a
So far it wasn't possible to test the prameters of the
project itself. While If7b749dae7631e8714a9416dfbd82d2443c0302c
already made the job creation consistent this goes one step further
and creates the root_xml using the project's root_xml method.
Change-Id: Ieba4203d3d23ad68df5a1246e90ea8c03ddd54d4
Defining a project (in yaml) without setting any other parameters should
generate a basic jenkins job (in xml). While this works for freestyle jobs,
jjb will throw an error for maven and flow projects. The behavior should be
consistent across all types of projects. This patch just makes it so
that the behavior is consistent.
Change-Id: If7b749dae7631e8714a9416dfbd82d2443c0302c
Add documentation on how to generate documentation and run JJB unit tests.
Also added a unit tests for each category of plugins as examples for others
to follow when adding new JJB plugins. I'm hoping this will help contributors
add tests for new plugins going forward.
Change-Id: I2ab90cdb37d0f3b1e947345d4291d2927b04a0c6
This patch refactors the tests suite to use a base class to declare test cases
just using a class declaration, the existing test class was modified to use it
and new tests are using it as well.
These tests verify the XML generated when the 'node' option is set and
when it's absent.
Change-Id: Iddcdd63e0ab7c459f6513b1d1ebf19e19a362c1d