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
With the introduction of tempest plugins we can now remove the third
party tests for the ec2 api using boto. They've always been the ugly
duckling in tempest (except that it never turned into a swan) where
they go against some of the fundamental principles of tempest tests.
For exaple, like having it's own client implementation, oh and testing
OpenStack APIs. This patch removes all the pieces of the third party
test dir and deprecates all the config options related to boto. A
plugin implementation is being worked [1] that can be used to fill
the coverage hole left by removing these from the tempest tree
[1] https://github.com/mtreinish/tempest_ec2
Change-Id: Ib5e24e19bcba9808a9f49fe7f328668df77fe4f9
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
There is no argument "top_level" available. This causes an
error while using the plugin interface.
Change-Id: Id628b68b651144a08ca263dd0dc056987b108e69
Closes-Bug: #1474685
As stated in the initial design spec rename test.plugins to
test_plugins.
Partially Implements bp external-plugin-interface
Change-Id: Ib019d0849cb9405eef010d679caad236c821ce81
OS_TOP_LEVEL environment variable allows for the tempest code
to be in a different tree compared to .testr.conf.
However test_discover does not work because relative path is
passed in as top level. Fixing that.
Change-Id: Ieee0704c4895381bc64234bb18e720df67187aad
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
The cli tests have been marked for removal for ~6 months and the
framework was the first thing included in tempest lib. There has
been more than enough time for all the projects to pick this up
in the client repos. So let's remove it all!
As part of this a couple of missing entries for tempest's
requirements.txt were found. These dependencies were being installed
by the clients so the fact they were missing was never noticed prior
to this. This commit also adds these missing entries back into the
requirements file.
Change-Id: I4f8638f1c048bbdb598dd181f4af272ef9923806
The tempest master branch with tox -efull with py26 command,
produces a lot of tierDownClass failures,
because it tries to tearDown an already tearDowned class.
By switching to unittest2.TestSuite the issue is solved.
Change-Id: I7a5d21af62bafb13cdc8a0dcc20ed3f742aa214f
We don't need to have the vim headers in each source files. We can set
it in our vimrc file instead. Also if set incorrectly, gate (pep8 check)
will catch the mistakes.
More discussions:
http://lists.openstack.org/pipermail/openstack-dev/2013-October/017353.html
Change-Id: I43703e2289212389c7841f44691ae7849ed1f505
Closes-Bug: #1229324
This commit adds a load_tests hook that will be used to discover the
set of tempest tests that excludes the unit tests. We can't just
discover from the tempest topdir like we previously did because of
mutually exclusive requirements between the normal tempest tests and
the unit tests. (for example mox and mock should not be required for
a tempest run)
Change-Id: I562f033d78e654675fd77af3bf64c44945127bd7