Commit Graph

18 Commits

Author SHA1 Message Date
Vsevolod Fedorov 67645a46eb Fix legacy plugin version comparison; Remove cap on setuptools version
LegacyVersion class is removed from newer setuptools package. But
support for legacy versions is added in python-jenkins 1.8.2.
Switch to that implementation.

Fix broken plugin version comparison for legacy versions.

Assume latest plugin version if no plugin version is found.

Story: 2010990
Story: 2009943
Story: 2009819
Story: 2010842
Task: 49236
Task: 44852
Task: 44396
Task: 48448

Change-Id: Id7f0be1c42357454bd9bedcdee3fefb174943d81
2023-12-19 12:10:43 +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 08678825a9 Update Gerrit Trigger Plugin Implementation
The changes between plugin version 2.30.0-2.32.0 have been
implemented. Current test cases are updated, and also new
test cases are added in order to verify old version XML
output has not been altered.

Documentation uses gerrit004.yaml as an exampple, therefore,
`build-cancellation-policy` have also been implemented to
show as example.

Signed-off-by: Eren Atas <eatas.contractor@libertyglobal.com>
Change-Id: I55fb6f8dd722d50cff369a6fba0e11c96b0c08aa
2021-05-20 15:14:46 +02:00
sp-ricard-valverde c1d8a41666 feat(scm): add git extension for lfs-pull
Add a missing extension to git scm which enables the option to do
"Git LFS pull after checkout"

Add lfs-pull fixtures

Change-Id: Ie8b98877f3f282ac0b32dbeb089e6d0d9ccc25c8
2021-03-16 18:29:56 +01:00
Adam Romanek b04ca3a82c Gerrit Trigger: update support to the latest plugin version
The changes include:

- deprecated the following options and made support for them dependent
  on the Gerrit Trigger plugin version:
  - 'no-name-and-email'
  - 'readable-message'
  - 'trigger-for-unreviewed-patches'

- added a set of new options:
  - 'name-and-email-parameter-mode' (replaced 'no-name-and-email')
  - 'commit-message-parameter-mode' (replaced 'readable-message')
  - 'change-subject-parameter-mode'
  - 'comment-text-parameter-mode'
  all these options can have one of the following values:
  - NONE
  - PLAIN
  - BASE64
  the default value for the first two options is taken from the
  respective options they replaced, if they exist in the input YAML
  file, so the overall change should be backward compatible

- fixed the value generated for <dynamicTriggerConfiguration> element
  it should be "true"/"false" instead of "True"/"False"

- added an empty <dynamicGerritProjects> element when dynamic trigger
  functionality is disabled to match what the plugin does

With the above changes the markup generated by JJB is fully aligned with
Gerrit Trigger plugin v2.30.x. Tested on Gerrit Trigger plugin v2.30.0.

Task: 39871
Story: 2007722
Change-Id: I25800874f51a93a351926a9a1be255cce80b88bd
2020-06-01 15:39:18 +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
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
Zuul ed07d8fa94 Merge "Fix timeout wrapper version detection" 2018-02-08 20:55:26 +00:00
Sorin Sbarnea ea324d31d2 gerrit-trigger: avoid exception spamming logs
Adds empty triggerInformationAction section which when
missing was generating recurring spam on Jenkins logs.

included null not assignable to interface hudson.model.Action

See https://issues.jenkins-ci.org/browse/JENKINS-45788

Change-Id: I97efbfcb17388b5ca99901aa35f4311c8db77710
2018-02-06 12:16:35 +00:00
Thomas Bechtold ecf3933dc2 Fix timeout wrapper version detection
If, for whatever reason, the version of the build-timeout
plugin can not be detected, assume that we use a newer version (>= 1.14).
Version 1.14 is already ~ 2 1/2 years old so this is a sane assumption.
Also adjust fixtures to use the newer plugin version xml output.

Change-Id: I86295933d0c3247f55d0114473fc9c8f8feb7441
Signed-off-by: Bertrand Roussel <broussel@sierrawireless.com>
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
2018-01-09 09:02:29 -08:00
Jenkins 4f77324fea Merge "Wrapper pre-scm-buildstep: added support for failOnError parameter" 2017-03-29 09:55:34 +00:00
Sandro Gattuso 12c2ca3396 Wrapper pre-scm-buildstep: added support for failOnError parameter
- Added failOnError argument for pre-scm-buildstep
- Introduced buildsteps argument and moved list of build steps to match xml configuration of the preSCMbuildstep plugin.
- Updated existing test cases to match the new argument structure
- Added test case for pre-scm-buildstep to verify creation of failOnError tag
- Added verification on version to maintain retro-compatibility
- Updated documentation to fetch example from testcase definition

Change-Id: I25c19cd0552cf2de97b9c391492d95779c1360be
Task: 3163
Story: 2000690
2017-03-28 17:10:29 +00: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
Jeff Grafton cdfeb7bf66 Update Git SCM so that extensions are configured correctly.
Many configuration options have been extensions for at least 2 years, so
update the generated XML to actually configure these options.

Change-Id: Ic22ca4a6b8d61c977979a5eb63a2e884dc4391bd
2016-06-06 13:35:04 -07:00
Reinhard Tartler 440acd0fa1 Add support for disable-strict-forbidden-file-verification
Enabling this option will allow an event to trigger a build if the event
contains BOTH one or more wanted file paths AND one or more forbidden
file paths.  In other words, with this option, the build will not get
triggered if the change contains only forbidden files, otherwise it will
get triggered.

Support for this was added in Plugin Version 2.16.0.

Change-Id: I860b076c2393909012c3ac9821559c9e8c9f7e28
2016-03-10 04:44:21 +00: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
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
Khai Do e52bb31fa1 Document that jjb supports json job definitions
Add documentation to let users know that they can also define jobs
in JSON.  Create a new test suite to verify that jjb can correctly
generate jenkins xml from json definitions.

Change-Id: Idb5216b0b56837d0f4dd2298986149be66bd217e
2015-07-28 17:20:29 -07:00