Commit Graph

22 Commits (cd147631f8254c2f727ccfc937566a7a200349f9)

Author SHA1 Message Date
Ghanshyam Mann aa7c147492 Add logs for plugins data
While loading data form plugin like tests,
config options etc we do not have enough logs
to debug if any plugins is missed.

It is difficult to debug in such cases where we do not
find config options registered by plugins,
For example:

Adding more logs to know what all data we are loading from
all plugins.

Change-Id: I09d2349a0e32c2265e6beb3dad4619ad33782a51
2020-04-16 17:22:39 +00:00
afazekas 40fcb9ba28 Add autopep8 to tox.ini
autopep8 is an automated code formatting tool for python,
it does not know everything, also not super fast,
but it is faster than I can manually reformat the code.

tools/ will call the formatting,
the tox will check did you called it.

Also adding a tox -eautopep8 way to use it.

autopep8 formats the lines in one way,
where tempest used a another way it was changed.

Change-Id: I6d51b14a5a5b87761071d0927fca23ba1651aa41
2019-03-08 16:04:05 +01:00
Andrea Frittoli (andreaf) 17e96e1bf5 Fix doc issue in
The documentation for `register_opts` in includes two
examples, and 2nd one is ok but the 1st one is not.

Change-Id: Iecc9a2442b430ef31885f9455b8e43a4470f0e2d
2017-11-05 21:41:33 +11:00
Andrea Frittoli f1c6825210 Add docstring example for get_opt_lists
Add an example (typical) implementation of get_opt_lists.

Change-Id: If597838f828f81c0919c11a8436b1a0d322758a4
2017-04-24 10:07:39 +00:00
Masayuki Igawa 683abe2a39
Improve docstring examples
This commit improves docstring examples. The original examples are
written in interactive mode style. However, I feel it's weird when it is
multiple lines, especially. So, this commit just removes '>>> ' and
updates some code block attributes.

Change-Id: I2f46042607c0f57d93634fbdffbb4400256a8489
2017-04-14 14:29:05 +09:00
Stephen Finucane d114804f1a Use Sphinx 1.5 warning-is-error
With pbr 2.0 and Sphinx 1.5, the setting for treat sphinx warnings as
errors is setting warning-is-error in build_sphinx section. Migrate
the setting from the old warnerrors one.

There are a couple of small items to be cleaned up.

Change-Id: I01b1ac49c69d001ea25a475d903311d0b592656e
2017-03-23 11:51:45 +00:00
Andrea Frittoli 382a6f12a3 Add plugin group names to CONF
Plugins have no way of setting the name of their groups to CONF
so that they are available at discovery time, so setting them
up for them, using the get_opt_list hook.

Since plugins may pass an OptGroup object or a string, handle
both cases. Normalise strings with a '-' to '_'.

Added comments and docstring to document this.

Change-Id: I1afae0d1f9c4a6aec2742aaba4928cdde54b224f
2017-03-13 14:20:32 +00:00
Andrea Frittoli 8b23c79325 Move plugin client registration to proxy
The plugin client registration is triggered to early, which leads
to the CONF object being initialised twice. Moving the plugin
client registration to live together with the tempest own client

Change-Id: I7c15e8c5ee9c7421ac410cfaa84b3ce21380f5e7
2017-03-09 13:27:18 +00:00
Anusha Ramineni f3eb9479e2 Use oslo.log library instead of system logging module
The constants of log levels were added in the 1.8 version of
the oslo.log library. So we can replace all usage of system
logging module with log module from oslo.log.

Change-Id: Ide50502f020eb1309648f4f9fc8a9c17aa1a1d9c
2017-01-16 05:56:54 +00:00
Jordan Pittier 525ec718f6 Hacking: enable H904
It's a really cool rule that will avoid suboptimal usage of the
logging library.

Change-Id: I6414624f6b51333d477dd88290158aaeb51b851f
2016-12-19 16:25:24 +01:00
Matthew Treinish 00c72b90f6
Only call register_service_clients if there are clients
Right now we unconditionally run register_service_clients() on each
plugin regardless of whether there are any clients or not. This can lead
to false tracebacks being logged if there is any error reported in the
call path, regardless of whether the plugin is at fault or not. To
avoid this potential confusion this commit changes the registry call to
only occur if there are any clients we actually want to register. If
there aren't any we just skip that plugin.

Change-Id: I526d4acd99bbcfbf27c4090391f341bc61fdb194
2016-10-05 11:27:13 -04:00
Andrea Frittoli (andreaf) e07579c603 Migrate service_clients to tempest.lib
Migrate the service_clients module to
Migrate related unit tests as well.

The clients module atm imports from Tempest which is not
allowed via hacking to avoid cirtular dependencies.
If there is no way around this, I will have to remove the self
registration of the service clients from plugins, and ask the
plugins to do the registration themselves - which is a pity. Ideas?

Change-Id: I40e3478f69af62a7cdc14fa65ed21dcfbbe10e72
2016-08-05 16:23:26 +01:00
Andrea Frittoli (andreaf) 6d4d85ab70 Service Clients registration interface for plugins
Add a new registration interface to service_clients.
Add a new optional method to the plugin interface, that exposes
the plugin service client registration details.

Tests in plugins can initialise service_clients with parmaters
common to their service clients and other ones they may need.
Parameters specific to their service clients are passed via the
registration interface, and can be overwritten at any time
by passing extra parameters at client init time.

Partially-implements: bp client-manager-refactor
Change-Id: I2d99aaa317b0d21c0968dd25b21c4ba9088136fb
2016-07-26 22:52:33 +01:00
Andrea Frittoli (andreaf) db9672e347 Use tempest.lib code in tempest
Now that tempest_lib code is copied back into tempest, stop using
tempest_lib in tempest, and start using the copied code.

Remove the dependency to tempest_lib from requirements, and drop
the script to use tempest_lib in tempest. Add os-testr to the

Partially implements bp tempest-lib-reintegration

Change-Id: I21ab5fe6349f72c98ac9f960a29bf62e813f8b1b
2016-02-24 10:43:59 -05:00
Ken'ichi Ohmichi 2e2ee19179 Fix H404/405 violations for remaining
There is a lot of H404/405 violations in Tempest now, and that leads
difficult to migrate the code to tempest-lib or the other projects'
repos. This patch fixes these violations for remaining.

Change-Id: I3abac40ebb33836980c119d59bc97f035b213c0a
2015-11-19 11:22:29 +00:00
Matthew Treinish 1bc49b951c Handle exceptions from plugins gracefully
If a tempest plugin is poorly constructed and raises an exception
during register_opts this can interfere with the rest of tempest
running correctly. This commit makes the tempest plugin handling
a bit more defensive so things don't crash if a plugin raises an
exception, instead the error is logged and tempest moves on.

Change-Id: Ic133eee1cced5ca3c53334d3d30c7b0b043ff789
2015-10-09 16:29:55 -04:00
Matthew Treinish 83a19aa4b1
Add plugin interface for extending sample config generation
This commit adds a method to the external plugin interface to extend
the list of config options that gets passed to the sample config

Partially implements bp external-plugin-interface
Change-Id: I3d28b93aa0cbd05cff3322ff60afadd18baf354a
2015-08-03 12:03:15 -04:00
Jenkins 91a9548c14 Merge "Add plugin interface for appending to tempest config" 2015-07-27 05:59:29 +00:00
Marc Koderer 25319f6fa0 Stop test execution in case of an plugin error
Without setting the on_load_failure_callback parameter
failures are ignored (only logged). This can be critical in
gate jobs.

Change-Id: I820784d759d6dc60ed86d29d90ef900207d848ad
Closes-Bug: #1474765
2015-07-15 11:28:38 +02:00
Marc Koderer 191419c4bc Rename test.plugins to test_plugins
As stated in the initial design spec rename test.plugins to

Partially Implements bp external-plugin-interface

Change-Id: Ib019d0849cb9405eef010d679caad236c821ce81
2015-07-14 14:30:45 +02:00
Matthew Treinish a966d0f83b
Add plugin interface for appending to tempest config
This commit adds a new interface to the external plugin interface for
adding configuration options to the config file. This is accomplished
by adding a method to the abstract class which plugins can use for
registering additional opts on the tempest config object. Then on the
tempest side a method is added to the plugin manager class to call the
register function for each plugin. This is then called at the end of
tempest's normal register_opts() function.

Partially Implements: bp external-plugin-interface

Change-Id: I2a7915cd978c496091dcf2cbf9d6a89ecbd8c2aa
2015-07-07 11:35:23 -04:00
Matthew Treinish 7a51877e3c
Add basic external test plugin support to tempest
This commit starts the basic framework for using external plugins in
tempest. It adds a new singleton class to load the plugins once from
stevedore and also provides an interface for different steps in the
tempest execution to use plugins as well as in-tree code.

As part of this an ABC abstract class is created to simplify the
plugin side creation. Eventually the expectation is that this
abstract class will live in tempest-lib. But, for right now while
this feature is still experimental and under development this will
likely change frequently so it'll live in tempest for the time being.

Partially Implements bp external-plugin-interface

Change-Id: I8ebabdb4ce9f4d3b3aca375158835f907d5ca315
2015-07-07 11:34:13 -04:00