Commit Graph

29 Commits (0ea2c01d757375d54aa9a9de34c2c9995bb48d13)

Author SHA1 Message Date
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/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
4 years ago
Andrea Frittoli (andreaf) 17e96e1bf5 Fix doc issue in plugin.py
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
6 years ago
Andrea Frittoli f1c6825210 Add docstring example for get_opt_lists
Add an example (typical) implementation of get_opt_lists.

Change-Id: If597838f828f81c0919c11a8436b1a0d322758a4
6 years ago
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
6 years ago
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
6 years ago
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
6 years ago
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
registration.

Change-Id: I7c15e8c5ee9c7421ac410cfaa84b3ce21380f5e7
6 years ago
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
6 years ago
Jordan Pittier 525ec718f6 Hacking: enable H904
It's a really cool rule that will avoid suboptimal usage of the
logging library.

Change-Id: I6414624f6b51333d477dd88290158aaeb51b851f
7 years ago
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
7 years ago
Andrea Frittoli (andreaf) e07579c603 Migrate service_clients to tempest.lib
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
7 years ago
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
7 years ago
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
test-requirements.

Partially implements bp tempest-lib-reintegration

Change-Id: I21ab5fe6349f72c98ac9f960a29bf62e813f8b1b
7 years ago
Matthew Treinish 42d69512d9
Remove the ec2 api tests from tempest
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
8 years ago
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
8 years ago
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
8 years ago
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
generator.

Partially implements bp external-plugin-interface
Change-Id: I3d28b93aa0cbd05cff3322ff60afadd18baf354a
8 years ago
Jenkins 91a9548c14 Merge "Add plugin interface for appending to tempest config" 8 years ago
Jenkins 0db5946fd4 Merge "Stop test execution in case of an plugin error" 8 years ago
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
8 years ago
Marc Koderer 704f3441de Fix error in loader.discover() call
There is no argument "top_level" available. This causes an
error while using the plugin interface.

Change-Id: Id628b68b651144a08ca263dd0dc056987b108e69
Closes-Bug: #1474685
8 years ago
Marc Koderer 191419c4bc Rename test.plugins to test_plugins
As stated in the initial design spec rename test.plugins to
test_plugins.

Partially Implements bp external-plugin-interface

Change-Id: Ib019d0849cb9405eef010d679caad236c821ce81
8 years ago
Andrea Frittoli (andreaf) d30fe3b8b9 Provide a full path top level to test discovery
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
8 years ago
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
8 years ago
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
8 years ago
Matthew Treinish 464d287f5b
Remove CLI testing once and for all
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
8 years ago
Attila Fazekas efe84bb451 Use unittest2.TestSuite with py26
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
9 years ago
Masayuki Igawa e8d31a0b80 Remove vim headers
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
10 years ago
Matthew Treinish 87f772c0bd Add test_discover module to provide a load_tests hook
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
10 years ago