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: https://review.opendev.org/#/c/706785
Adding more logs to know what all data we are loading from
all plugins.
Change-Id: I09d2349a0e32c2265e6beb3dad4619ad33782a51
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/format.sh 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
The documentation for `register_opts` in plugin.py includes two
examples, and 2nd one is ok but the 1st one is not.
Change-Id: Iecc9a2442b430ef31885f9455b8e43a4470f0e2d
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
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
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
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
registration.
Change-Id: I7c15e8c5ee9c7421ac410cfaa84b3ce21380f5e7
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
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
Migrate the service_clients module to tempest.lib.services.clients.
Migrate related unit tests as well.
The clients module atm imports plugin.py 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
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
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
test-requirements.
Partially implements bp tempest-lib-reintegration
Change-Id: I21ab5fe6349f72c98ac9f960a29bf62e813f8b1b
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
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
This commit adds a method to the external plugin interface to extend
the list of config options that gets passed to the sample config
generator.
Partially implements bp external-plugin-interface
Change-Id: I3d28b93aa0cbd05cff3322ff60afadd18baf354a
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
As stated in the initial design spec rename test.plugins to
test_plugins.
Partially Implements bp external-plugin-interface
Change-Id: Ib019d0849cb9405eef010d679caad236c821ce81
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
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