Commit Graph

44 Commits

Author SHA1 Message Date
Vsevolod Fedorov c1ac0e03d6 Story: 2010984 Fix folder tests and defaults for folders
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
2023-12-04 10:51:55 +03:00
Vsevolod Fedorov f4d64f9f66 Move tests to pytest
Pytest makes each scenario into individual selectable test.
To be able to run each scenario separately is very useful for development.

Change-Id: I4b1c990a1fd839ce327cd7faa27159a9b9632fed
2022-12-20 10:44:43 +03:00
Eren ATAS 2e84bdf5b6 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>
2020-07-07 11:32:51 +02:00
Thanh Ha 4d90c187a9 Auto-generated output from python-black
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>
2019-09-09 19:23:24 +01:00
kendallpcdoctor 5117d87e8c Add support for two new plugins, and a new version of one
Added new support for the following plugins:
Perforce plugin: https://wiki.jenkins.io/display/JENKINS/Perforce+Plugin
InfluxDB plugin: https://wiki.jenkins.io/display/JENKINS/InfluxDB+Plugin

Added support for v3.0 of the following plugin
https://wiki.jenkins.io/display/JENKINS/Priority+Sorter+Plugin

Change-Id: If109863a91710c08b34dee622496e551a7b3b520
2019-07-25 13:12:49 -07:00
Mykola Nikishov bc55a673a0 Do not ignore global-settings-type in Maven module
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>
2019-01-04 23:58:20 +02:00
Sorin Sbarnea c2781e670f
Normalize newlines at end of file
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>
2018-06-29 16:07:06 -04:00
Daniel Richardson 0f45ba0351 bug/2002053 allow None for auth-token
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
2018-05-16 23:29:38 -07:00
Andrea Scarpino dff7df4ef0 Maven project: allow to disable trigger downstream projects
Change-Id: Ie4af949ad686f007d3091d947ef65c670262f8d4
2018-02-27 17:57:12 +00:00
Darragh Bailey af9d984baa
Basic folder support
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
2017-10-23 13:29:21 -04:00
Antoine Musso 7b1c47711d Complete support of Yaml Axis Plugin
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
2017-06-22 16:34:37 +02:00
Darragh Bailey 4573b3a25d Refactor base test classes inheritance for reuse
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
2016-09-14 14:58:57 +01:00
Thomas Desvenain 2da05c83c4 Added a doc entry and a test for jdk general parameter
Change-Id: I8e42e0a10f1fba2fd0e2931481f5e720be278b9d
2016-07-22 12:46:20 +02:00
Darragh Bailey bafc09598f Compatibility support for older maven project plugins
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
2016-05-03 18:45:49 +01:00
Nicolas Glayre 832a99b6e1 Removing perModuleEmail paramater management
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
2016-04-23 16:11:47 +01:00
Jenkins c2d614f451 Merge "Partial support Yaml Axis Plugin" 2016-04-23 14:56:52 +00:00
Thanh Ha 5cdbb719af
Fix CFP configuration for >=2.10.0
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>
2016-04-22 09:08:59 -04:00
Antoine Musso 49a5ea159c Partial support Yaml Axis Plugin
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
2016-03-01 16:52:28 +01:00
Darragh Bailey 8805a34c0f Reorder imports to match hacking guidelines
Ensure that the imports follow the standard OpenStack hacking
guidelines.

Change-Id: Iaa4326aef118ddfd807dd006934f1d9ca80a1cfa
2015-12-23 15:23:42 -08:00
Jonathan Perret a63d3c8d11 Allow raw XML at project top-level
This allows a `raw` section at the top-level of a job definition.

Change-Id: Id76bbfbde8df49b221fcd1198354ba8b5ce9fb02
2015-10-09 23:08:11 +02:00
Darragh Bailey 9bfbffa559 Capture logs with FakeLogging Fixture
Capture logs to attach them on exceptions to simplify the debugging of
errors in tests when they occur.

Change-Id: I5c1b5c306aba37789a8d41eabf65e0ac628af838
2015-09-30 16:25:22 +01:00
Daniel Danner aeeaf71784 Add support for GroovyAxis
Change-Id: I8661910761ed2a3faab0dcf021fd23ceb71e150b
2015-08-17 13:24:58 +02:00
Jenkins 297078d405 Merge "Support for externaljob project-type for monitoring external jobs" 2015-08-07 10:16:43 +00:00
Somay Jain 92b7f446f9 Support for externaljob project-type for monitoring external jobs
Change-Id: I8904725f75d27180d44c55768605db7d67e79586
2015-08-01 12:45:40 -07:00
Fathi Boudra b72b10dd44 general: add support for childCustomWorkspace
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>
2015-07-13 10:16:58 +03:00
Somay Jain 25a507ff8f Support for post-step-run-condition in Maven projects
Change-Id: I87e1b58ad69330f3bb44070513ac90ec03b65cb4
2015-06-27 21:03:46 +05:30
Somay Jain d09f6d5ec0 Improvements in the Maven Plugin.
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
2015-05-26 00:58:13 +05:30
Jan Hruban 10da7c60e8 Support additional features in Build Flow project
* Allow requiring a workspace.
* Allow running a DSL script from file.
* Adding job parameters documentation.

Change-Id: Ida71e40df3dd440d956b91005d932915bdb3d4f7
2015-03-03 21:53:38 +01:00
Teemu Suvanto 9d57c4c47f Fix wrong casing in JDKAxis <name> tag
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
2015-02-17 19:17:43 +09:00
Teemu Suvanto a322faefb7 Add support for JDK axis
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
2015-01-29 10:12:27 +09:00
Jenkins 4bf020e07e Merge "add support for python and tox matrix project axis" 2015-01-12 15:48:56 +00:00
Kyle Rockman f82ab9a021 add support for python and tox matrix project axis
Change-Id: I89ffc04faed02fd72c934b44b6832bd1f11d8f2e
Signed-off-by: Kyle Rockman <kyle.rockman@mac.com>
2015-01-08 14:13:40 -06:00
Thanh Ha 1e21683521 Add support for Config File Provider to Maven Project module
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>
2014-11-22 17:38:29 -05:00
Fathi Boudra c5d3e71cca matrix project: add support for dynamic axis
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>
2014-06-06 11:02:39 +03:00
Jenkins 8fe3061876 Merge "Allow custom settings configs for maven projects" 2014-05-02 20:00:42 +00:00
Andrew Grimberg 9b32e0fbad Allow custom settings configs for maven projects
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>
2014-04-02 16:51:03 -07:00
Vitaliy Lotorev c9c784aecc add retry-count in general.py
implement retry-coutn in general.py;
update doc and add test fixtures

Change-Id: Ifeb4fb645ad0e4bc12d41ef4481aca1888a4041a
2014-03-28 00:41:22 +04:00
Guido Günther 04052d8769 project_maven: allow to set private repository
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
2014-01-27 23:32:50 +01:00
Guido Günther 828e134c7e project_maven: Don't require artifact-id and group-id
Jenkins will determine the values from the pom automatically so there's
no need to require them.

Change-Id: Ic1c9c26a05e335fd78a92fe4316ecc88b3f209b9
2014-01-23 08:38:52 +01:00
Guido Günther d1846e7dfc tests: Allow to test project parameters
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
2014-01-23 08:38:51 +01:00
Khai Do b47fe61905 make job creation consistent
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
2014-01-22 15:21:14 -08:00
Kei YAMAZAKI 604d39305b Fix multibyte character problem
Fixed problem that causes a UnicodeEncodeError when use multi-byte characters in the job.yml.

Change-Id: Ie715c827a794e73fae11cdca079ea80cfb8c280d
2014-01-21 22:34:30 +09:00
Khai Do b790bbc681 update doc and add new JJB unit tests
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
2013-11-22 17:51:17 +00:00
Felipe Reyes 894c72efcf New base class to declare test cases and tests to the node option
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
2013-11-14 13:53:23 +01:00