Commit Graph

12 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
Eric Ball 97ad297610 Fix: Avoid LegacyVersion casting due to hyphens
Plugins are no longer following semantic versioning, and frequently
include additional versioning information.

pkg_resources.parse_version generally handles this well, but some
versions with a hyphen will return a LegacyVersion object rather than
a Version object, causing it to always compare as lower than any
Version object.

Simply replacing any '-' with '+' fixes this issue, and does not
materially change the versioning.

Signed-off-by: Eric Ball <eball@linuxfoundation.org>
Change-Id: I5ad949d688ce7ebd0d183d69f4ce87b35343357f
2022-04-12 11:21:49 -07: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
Evgeni Golov 430f1b4694 properly support private builds in the registry
when building snapshots, maven will sometimes add some information
*after* the -SNAPSHOT like this:
 1.4.6-SNAPSHOT (private-0986edd9-egolov)

the old registry code would transform this to
 1.4.6.preview (private-0986edd9-egolov)
which is not a valid version string for pkg_resources.

strip everything after the -SNAPSHOT tag and thus produce a clean
version string that is comparable properly

Change-Id: I765c991ac7632b3c76f548112d2a5323a8ce4489
Signed-off-by: Evgeni Golov <evgeni@golov.de>
2017-04-28 11:20:04 +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
Wayne Warren 0da11b51c5 Use JJBConfig in ModuleRegistry.
Remove reference to ConfigParser object in ModuleRegistry. Instead:
* make use of JJBConfig.get_module_config to grab settings for Hipchat
  Notifier Plugin
* make use of JJBConfig.yamlparser['allow_empty_variables'] rather
  than repeating ConfigParser logic moved out of the YamlParser into
  JJBConfig in an earlier commit.

Change-Id: Icb7ef514826005545e48af993335ce120f973b0d
2016-07-22 17:33:30 +01:00
Wayne Warren b6e9080a89 Finish removing code from jenkins_jobs.cmd
* Move behavior of jenkins_jobs.cmd.execute() into
  jenkins_jobs.cli.entry.JJBConfig.execute()
* Delete jenkins_jobs/cmd.py
* Fix up unit tests to deal with rearranged code.

Change-Id: Ia0d3a062de16c4be10863372c753f4ba8480e620
2016-07-22 17:15:36 +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
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
Wayne 4a8b93b8c2 Remove YamlParser from jenkins_jobs.builder
The goal of this patch is simply to move some classes out of
jenkins_jobs.builder into more appropriately-named modules. This started with
simply moving YamlParser into jenkins_jobs.parser but led to other moves in
order to avoid cyclic imports since YamlParser uses other classes previously
defined in jenkins_jobs.builder.

That said, this patch doesn't intend to address all of the clutter in
jenkins_jobs.builder, mostly just what is necessary to get started working on
YamlParser independent of other classes in that module.

Change-Id: Ie88bf683e495033eb0b670fe29c256a70282735f
2015-04-22 11:59:07 -07:00
Wayne b4e5aa9b77 Add plugins_info to module registry object.
This makes it available for use by any module that has version-specific behavior
differences since modules always have access to the yamlparser which in turn
contains a module registry.

Change-Id: I1cae480a9a341ec2f6062904c962530dfce95057
2015-02-04 05:02:14 -08:00