Commit Graph

195 Commits

Author SHA1 Message Date
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
Pavel Sedlák c12f334ac7 Add sandbox option to dsl builder
Job DSL plugin supports execution of its groovy DSL code
via sandbox, but until now there was missing option to control it.

Change-Id: I8dccfc608cf59ac46ded712dc937983a22b9d3b3
2022-10-21 01:34:59 +02:00
Matthieu Baerts 1d6e580ff3
xunit: support versions 3+
A new major version (3.0.0) of XUnit plugin has been released in January
2021:

  https://github.com/jenkinsci/xunit-plugin/releases/

I didn't have an issue when I upgraded the plugin from version 2.4.0 to
3.0.0. But I started to have this error at the end of a build and I
guess it appeared only after having modified the configuration of the
Jenkins jobs with JJB:

  ERROR: Build step failed with exception
  java.lang.IllegalArgumentException: The tools section is required.
	at org.jenkinsci.plugins.xunit.XUnitProcessor.<init>(XUnitProcessor.java:139)
	at org.jenkinsci.plugins.xunit.XUnitPublisher.perform(XUnitPublisher.java:204)
	at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:752)
	at hudson.model.Build$BuildExecution.post2(Build.java:177)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:697)
	at hudson.model.Run.execute(Run.java:1932)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
  Build step 'Publish xUnit test result report' marked build as failure

When looking at the configuration of the job from the Web UI, the XUnit
plugin was enabled but left "unconfigured": no file to look at.

Apparently, JJB is sending a XML config that is not understood by XUnit
plugin anymore. I guess I didn't have any issue before updating the
Jenkins jobs with JJB because when upgrading XUnit plugin from 2.4.0 to
3.0.0, Jenkins migrated the config to the new format.

From what I see when analysing the generated XML from JJB and the one
from Jenkins after having configured a job manually, a sub-element has
been renamed, from 'types' to 'tools'. I suspect this is caused by this
commit:

  https://github.com/jenkinsci/xunit-plugin/commit/aa47ac57d

(XUnitBuilder class had this line: @XStreamAlias("types"))

So here, I simply picked 'tools' or 'types' for the sub-element and
depending on the plugin's version in both the builder and the publisher
parts. I'm only using the publisher but I guess the problem is the same
with the builder.

Tests have been adapted to verify both versions <3.0.0 and >=3.0.0.

Change-Id: Ie78539d0ae25ddc139ad9982cdffd2e683dd40b2
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
2021-03-17 16:21:33 +01:00
Artem Nikitin 3abe808991 Fix system_groovy issue
System groovy has difference with the simple groovy command. System
groovy result XML for system groovy command (script), looks like this:

    <hudson.plugins.groovy.SystemGroovy plugin="groovy@2.3">
      <source class="hudson.plugins.groovy.StringSystemScriptSource">
        <script plugin="script-security@1.75">
          <script>Groovy command</script>
          <sandbox>[true|false]</sandbox>
          <classpath>
            <entry>
              <url>...</url>
            </entry>
            ...
            <entry>
              <url>...</url>
            </entry>
          </classpath>
        </script>
      </source>
      <bindings>...</bindings>
    </hudson.plugins.groovy.SystemGroovy>

Change-Id: I85eb5848de2a817ab132559b53cbeb316931195f
2020-11-13 15:21:47 +00:00
Ben Douglas 6c55bc7821 Gradle plugin: Support parameter passing
Introduce 2 booleans in the Gradle builder section to support passing
parameters by System Properties and Project Properties

Change-Id: I0de1e20b85902263e0d83ccadd64d42fc2b37193
2020-06-01 17:23:57 -04:00
Christian Kanthak d8fa4f4126 Introduce disable-host-key-checking for builder ansible-playbook
Implemented new parameter "disable-host-key-checking" to make the
"anbile-playbook" builder compatible with version >=1.0 of the ansible
plugin. The parameter defaults to "false" for security reasons (as the
plugin does).
The old parameter "host-key-checking" is still written to XML to keep
code working in a setup with plugin version <1.0. This has no impact
on newer setups because the plugin with version >=1.0 ignores the old
parameter value.
For same security reasons the default value of old parameter
"host-key-checking" was changed to "true" to "fix" older setups which
have the parameter not defined.

Change-Id: I4a592c1a4d6ba8bb4f365ce505296cf5c09f7e19
Task: 39789
Story: 2007678
2020-05-15 11:24:34 +02:00
Michal Ovciarik 45f2458584 Add support for become in ansible playbook
Change-Id: Ia116f715042d4a4c8cc26ac45cf1a91be47435d3
2020-02-25 11:18:52 +01:00
Artem Nikitin fa688582a6 Add alias to multijob builder
It's helpful to have possibility to set `jobAlias` in case the
same job is used multiple times with different configurations.

Change-Id: Ic092c6b2f5d893e75ebce4aaebc7eaf88a8978a6
2019-11-13 09:08:38 +03: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
Zuul b1499530db Merge "Add support for "Build / Publish Docker Image"" 2019-01-02 13:31:54 +00:00
Dane Foster 774dd59f1e adds vault unlocking parameter to ansible builder
This commit adds a parameter to the ansible builder, vault-credentials-id.
This maps to the element <vaultCredentialsId> in the resulting job
definition, and has been tested against the Jenkins Ansible plugin
v1.0.

Change-Id: I40cfd9225923b29c9d2714a60279f1c88f6cb88c
2018-12-13 11:21:19 +13:00
Zuul 3958ed5923 Merge "docker-pull-image: Pull Docker image from Docker Hub/Registry" 2018-11-14 23:52:09 +00:00
Norbert Grünwald a1dba99eb7 Add 'publish-over-cifs' to the builders module
This adds the 'publish-over-cifs' action to the builders module.
It enables the "Send files to a windows share" build step,
provided by the "Publish Over CIFS Plugin".

Change-Id: I80cb2f86091ef53a284cf85a381294bbb6133010
2018-10-29 15:04:50 +00:00
tanhengyeow b7ee539bc5 docker-pull-image: Pull Docker image from Docker Hub/Registry
Change-Id: I66e638564605fd25504b6e06524a26f778880f06
Co-Authored-By: Anil Belur <askb23@gmail.com>
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
Signed-off-by: Anil Belur <askb23@gmail.com>
2018-10-29 15:04:37 +00:00
tanhengyeow 039c860dc2
Add support for "Build / Publish Docker Image"
Change-Id: Iac9ffcdcb4312818d53e1da9be92ecdbb84c8cc1
Co-Authored-By: Anil Belur <askb23@gmail.com>
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
Signed-off-by: Anil Belur <askb23@gmail.com>
2018-09-24 20:16:21 +05:30
Zuul ed468042ba Merge "config-file-provider: Add tests" 2018-09-21 11:38:36 +00:00
tanhengyeow 3c3028f5b8 docker-build-publish: Improve support for new options
Change-Id: I316989cc736bb4ffb6152c68e4b3ff598b4274db
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-09-10 01:57:31 +08:00
tanhengyeow b76d4da653 config-file-provider: Add tests
Change-Id: Id8e36d1745bd05527985d5ee9ddfba32c5fa197d
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-09-07 22:50:46 +08:00
Zuul 8815f8a4a7 Merge "Add new checkboxes for Xcode plugin" 2018-09-06 17:37:27 +00:00
Zuul d374917aae Merge "Add support for "Nexus Repository Manager Publisher"" 2018-09-06 15:26:10 +00:00
Will Soula f475a7fded Add new checkboxes for Xcode plugin
This change allows for the user to specify the following checkboxes:
* Upload Bitcode?
* Upload Symbols?
* Compile Bitcode?

The plugin defaults to these checkboxes being checked, so I kept those
defaults here.

Change-Id: I727611fd2a70f2157b05d030ec296c74a5b214a8
2018-08-28 15:10:57 -06:00
tanhengyeow a345b8372a copyartifact: Add support for new options
New options include:
1. exclude
2. result-var-suffix

This update affects copyartifact in builders.py

Change-Id: I682a10be47f049fe457e5bc199aa50a5583958a7
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-08-25 20:33:35 +08:00
Darragh Bailey de4fb862f3 Allow control of verbose option for publish-over plugins
The publish-over plugins all expose the option 'verbose' to all for
lots of debug output from the connection to be outputted to the jenkins
console. However by default this is supposed to be disabled ('false')
so update the existing code to switch to the correct behaviour.

Change-Id: Ie9acb1a005a25cd5c9f279cc89d5178eb8d54dd7
2018-08-23 14:57:33 +01:00
tanhengyeow 516858a9c4 ant: Refactor code to improve readability
Change-Id: I3d56a18b140e6660c91e144f5bd27db3d8fbded3
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-08-12 21:53:16 +08:00
tanhengyeow 3cedc7fb63 Add support for "Nexus Repository Manager Publisher"
Change-Id: Icf72b436048bc0364690da2f956ed8b564fa5aa5
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-08-04 13:17:15 +08:00
tanhengyeow ee86bc318c Add support for "Invoke Nexus Policy Evaluation"
Change-Id: I363e468cdb4b50a0c6cf924d00618fb0ec568588
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
2018-07-26 01:49:33 +08: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
Jef Mallal 3841555ab5 Add XUnit processing plugin to builders
Change-Id: Ib51da8d44bd467f9eec76d21a7e6f5014df43209
2018-06-28 15:24:01 +00:00
Zuul 4167c80d3d Merge "Add support for new option in config_file_provider_builder" 2018-06-21 17:35:52 +00:00
Yolande Amate 843929143b Add support for new option in config_file_provider_builder
Change-Id: Iab4ab936a44868abd4e0dbf3033107c0cf33e312
Task: 4669
story: 2001062
2018-05-21 14:18:43 -04:00
Zuul 53d100458d Merge "Add support for aggregated test results" 2018-05-16 09:30:02 +00:00
Will Soula afd7cc8475 Add XCode 9.1 Support
Branched from my xcode-20 branch and rebased from master
and added support for xcode 9.1 now that the xcode plugin has been
released

Due to:
https://issues.jenkins-ci.org/browse/JENKINS-45509

Change-Id: Ibd0f4c82b5e8f37a9da335c57786eae5dc91aefb
2018-05-10 10:27:16 -06:00
Major Hayden 3913c3e71a
Add support for aggregated test results
This patch adds support for aggregated test results in the Jenkins
MultiJobProject plugin.

Change-Id: I5c98f7814d33a740d9a70b584e00d1aa5f50e0ea
Signed-off-by: Major Hayden <major@redhat.com>
2018-04-20 15:49:27 -04:00
Brett Delle Grazie 2e77650a4e Sonar: Support sonar-scanner tag builder task (master)
Without this, a scanner cannot be selected

Task: 5711
Story: 2001206
Change-Id: I780596ce7f42019132b6c6c2bda9d0fdbd688f32
2018-04-06 11:51:43 +00:00
Yolande Amate 3caff2f7ca Update artifact_resolver to make use of convert_mapping_to_xml()
Update tests for minimal and full types and update docs with default
and required options.

Change-Id: If9aaa35e2d7943b6a49f976db83d9f6cae82005b
Co-Authored-By: Thanh Ha <thanh.ha@linuxfoundation.org>
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
2018-02-28 09:08:39 +00:00
Andrey Kostrov d845352863 Add `enhanced-logging` for `trigger-remote`
As for now, JJB lacks the ability to control the `Enable enhanced
logging` option of Parametrized Remote Trigger plugin.
This option allows the console log of the remote job to be printed in
the console log of the calling job.

This patch adds the option `enhanced-logging` to the `trigger-remote`
builder to control this checkbox.
The default value is set to `False` to keep the current behaviour for those
who do not need the logs.

Change-Id: I3d109603b4eb9ce247e5e6c4588053e1c61ba6ce
2017-12-18 14:25:28 +03:00
Will Soula c4aab5c22d
Update xcode plugin to support 2.0
Add new parameters:

* ipa-export-method
* development-team-id

Change-Id: I17cc69dc86c59fcddc8d821196424c01caa8f613
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
2017-11-28 10:40:43 -05:00
vbotay 5c05925d00 Add NodeJS executor build step
Currently there is no possibility to setup options for 'NodeJS Plugin'
https://wiki.jenkins.io/display/JENKINS/NodeJS+Plugin
But 'NodeJS Plugin' is widely used to get ability of executing JS in build step
So this patch introduces configuration options for 'Execute NodeJS script' build step.

Change-Id: Ie0a9863f235d4199a6de350036394b8d054eb1e9
2017-10-24 22:01:00 +00:00
Zuul 441add1aad Merge "ansible_playbook: add support for DoNotSpecify inventory type" 2017-10-23 18:07:07 +00:00
Zuul ffa96cca7b Merge "Add support for jira_issue_updater" 2017-10-23 17:11:44 +00:00
Daniel Watkins ba913ea800 Add support for unstable return parameter for shell builders
This continues to support the current string form for job configuration,
as well as adding a form that supports a mapping.  This mapping has two
keys: "command", containing the command to be executed (i.e. the current
string parameter); and "unstable-return", containing the exit code that
configures the exit code that should cause a build to be marked
unstable.

Change-Id: I43ecc883236bbf8fc6de7ed8992e6d90da7d48ac
2017-10-05 14:58:27 -04:00
Yolande Amate 024db19793 Add support for jira_issue_updater
Change-Id: I7ca54752e12540ef2de2d8d888da5e79ee4345e5
2017-08-28 23:17:53 +01:00
Evgeni Golov e3e83fc96e ansible_playbook: add support for DoNotSpecify inventory type
Change-Id: Idc72f9c1081a571bfc1ca69b74815b2c2033ef96
Signed-off-by: Evgeni Golov <evgeni@golov.de>
2017-08-10 12:30:52 +02:00
Thanh Ha fea089bbd6
Default cmake config to newest plugin format
Also update code to use convert_mapping_to_xml helper.

Change-Id: Ie41c21dae7cd7367c2b24d9c1b5b0132572e784f
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
2017-07-26 15:59:15 -04:00
Andrey Kostrov 8ae85cdb4d Extend multijob build step with "execution-type" option
Currently multijob build step has no support for executionType
parameter added in 1.22 version of Multijob plugin.
This parameter allows to specify strategy for triggering build steps
inside multijob stage and this strategy could be parallel (which
is default and only supported version) or sequental.
This patch fixes this problem and adds corresponding parameter
"execution-type" for such build step.

Change-Id: Ie139da844a64b1591b05ccacb7e107fa07bd218a
2017-07-18 13:13:52 +03:00
Jenkins 39faea3e5d Merge "builders: do not pass empty "preload-script"" 2017-06-20 16:00:51 +00:00
Dong Ma f0e874106e Update examples filename
Update examples filename from '*complete*' to '*full*' to make all
filename consistent.

Change-Id: I37d3f9bf43cae455639fc2611e33734ea2c24ebc
2017-06-11 17:15:44 +08:00
Jef Mallal ad5ae3e2d6 Builders: conditional-step fix
When multiple steps are used, the condition has the wrong kind of
conditional and is always "Always".

Add test that exercise multiple steps with a And condition.
Also add a dummy test when multiple steps are listed.

Fix https://storyboard.openstack.org/#!/story/2000594

Change-Id: I4802bec9db407a09b23eea7e31235136d8bb72c2
2017-06-05 22:04:56 +02:00
Ari LiVigni 1979a954d1 Add support for jms_messaging builder and publisher
- Added the following for builder and publisher
- Added all the fields for JMS Messaging plugins
- Added a minimal example
- Added a full example
- Added info in trigger for builder description of the plugin

Change-Id: Ifa209978dd38692da9f9d06bdf34782bd684a324
2017-05-22 13:30:26 -04:00
Jenkins 99b3cd55dc Merge "Builders: Add ansible-playbook builder" 2017-05-01 23:49:06 +00:00