Commit Graph

15 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
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
Daniel Watkins cb27698f74 Update hipchat example for new syntax
The hipchat001 and hipchat_rooms-list001 test/example were swapped (with
hipchat001 being renamed to hipchat_room001).

Change-Id: Ia00964726814d9b1c3a7cb6af20996da087c4ba1
Story: 2000315
Task: 2510
2018-05-31 15:40:19 -04:00
Darragh Bailey 906781a752 Migrate hipchat conf to new plugin style conf
Remove the old default hipchat configuration style in favour of
using the new plugin style and provide a mechanism to copy the url
value from the jenkins section automatically as part of a simple
migration.

This will allow removal of querying the jenkins section from existing
module code and allow for better isolation.

Change-Id: I6889777904ebabc01c044abcd31c9d8a20c255c4
2017-08-23 18:31:44 +01:00
Thanh Ha b093fee501
Add convenience function for plugin namespace
Plugins can use get_plugin_config() which will search in a plugin
namespace. For example:

[plugin "hipchat"]
authtoken = 123token

- Updated hipchat plugin to use get_plugin_config()
- Updated stash plugin to use get_plugin_config()
- Backwards compatibility is kept by falling back to the old
  configuration setting if the new one is not found.
- Warning is displayed if the old configuration method is used.

Change-Id: I7cff063e2d179a5d9a3f221c85de6864382bc477
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
2016-11-11 13:34:16 -05: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
Clayton O'Neill f1bae173ff Update Hipchat support to work w/all versions
The HipChat plugin has changed a good bit in version 0.1.9 such that it
is now purely using the publisher hook and it's acquired a few new
configuration items.

This patch ensures used of the existing format will be automatically
redirected to the newer publisher module which adds support for 0.1.9.

Change-Id: I39452e877b20bfc5654d46c90e91dd877a8ebeb0
Story: 2000301
Story: 2000324
2016-04-23 18:48:05 +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
Darragh Bailey dc464d943f Ensure tests run with ConfigParser object
Should always use a ConfigParser object when testing to allow unit tests
to check that calls behave as expected.

Read in the default configuration to align with expected usage, and fix
some issues caused by usage of dicts resulting in the option name
requested being taken as the default value.

Since '.get()' is a valid method for a dictionary object, take care to
ensure that we do not use a dummy dict object as this will not throw the
expected errors if a config file is not provided and will also treat the
option name as a default value resulting in the wrong data appearing in
the outputted XML.

Change-Id: I6abb85f0363a48f220914c52b74e5a5fb65b0faa
2015-08-11 16:36:08 +01:00
Kyle Rockman 295ed05bd0 hipchat bug fix
the current implementation of the hipchat notification types
is buggy on updates because it never sets previously enabled
types back to false if they are not specified in the yaml anymore
but were once true. also room can be blank so it will use the default
room as configured in the master jenkins configuration
also standardize the notify-* arguments even if jenkins plugin
is bad about it

Change-Id: I02547fb6474b66a4f3d21ec3bf766334c66cf14c
Signed-off-by: Kyle Rockman <kyle.rockman@mac.com>
2015-04-23 11:55:14 +01:00
Wayne 2c156b9606 (hipchat) Accept list of hipchat rooms.
Change-Id: I8c840fdebd58ed4dd22c6a5cafa549bfaf5357cf
2015-04-23 11:53:13 +01:00
Wayne d2f9258864 Add support for hipchat notifier 0.1.8
Change-Id: I834dc05465ea5a24e3743f400837482a82e02e70
Closes-Bug: 1377567
2015-04-17 14:52:59 -07:00
Michael Tupitsyn d4fee5f6d7 Support additional events for HipChat plugin
In newer versions, Jenkins HipChat plugin supports notifications for the
following events:

  notify-success
  notify-aborted
  notify-not-built
  notify-unstable
  notify-failure
  notify-back-to-normal

This commit adds support for these events in JJB. Also, introduces a
unit test for hipchat module and converts doc example generation to
literalinclude.

Change-Id: I3e09b4f2b41db58eb22ada89a633516e319a95bc
2014-10-24 13:10:21 -07:00