Commit Graph

11 Commits

Author SHA1 Message Date
Stephen Finucane 63c3466f29 Migrate to stestr
This is effectively os-testr but maintained.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I97183318f715b03f31145fa3d0f00bb7bc8a0c82
2022-03-23 10:23:00 +00:00
Chris Dent 86e94d9ab2 Correct concurrency of gabbi tests for gabbi 1.22.0
When running gabbi under testr, concurrency grouping is controlled
by a regex in .testr.conf. A module name change in gabbi 1.22.0
inadvertently broke the grouping. This change should work for
old and new versions.

Change-Id: I9c875d8c73ccdfe633279914259061a8c3a7bf3d
2016-06-16 12:45:33 +01:00
Julien Danjou 8372f48b7a Rename to aodh
Change-Id: Ibd4c9811daa6e9e692457ce480a58c964fef7cb9
Signed-off-by: Julien Danjou <julien@danjou.info>
2015-06-25 14:46:39 +02:00
Chris Dent 552c63849e Declarative HTTP testing for the Ceilometer API
A 'gabbi' tox target is added which runs a declarative HTTP tests
described in YAML files in 'ceilometer/tests/gabbi/gabbits' and loaded by
'ceilometer/tests/gabbi/test_gabbi.py'. These are driven by the 'gabbi'
python package (available from PyPI).

tox and testr are configured to start and run the tests efficiently:

* a mongodb server, using multiple databases, is made available
* the API wsgi application is used directly via 'wsgi-intercept', no
  web server required
* each YAML file is run as a sequence and where number of processors
  allows, in a different test process
* individual tests can be requested in the usual way:

    tox -egabbi -- <test pattern>

  If this is done, all the tests prior to the one requested, from
  its YAML file, will be run as ordered prerequisites.
* tox targets that already run the tests in ceilometer/tests will
  also discover gabbi tests. If there is no mongodb, they will
  be skipped.

A ConfigFixture does the necessary work of adjusting the configuration
and pipeline to use the mongodb database and nothing else. An
internal InterceptFixture uses wsgi-intercept to access the
ceilometer API. Each yaml file has its own intercepted host.

Fixtures are implemented as nested context managers that are declared
per YAML file, see ceilometer/gabbi/fixtures.py and fixtures-samples.yaml
for an example of how they can be used. Every yaml file uses at
least ConfigFixture.

YAML files can use a variety of strategies for formatting requests
and evaluating the correctness of response. See:
http://gabbi.readthedocs.org/en/latest/format.html

The YAML files included here test simple API features for creating and
retrieving samples. Subsequent patches can (and should) create
additional YAML files to describe more complex scenarios that cover
the entire API (for example alarms are not touched at all by this
patch).

Change-Id: I52551f88bc3beac4bf8a92afa45ac70cd97ffcec
Implements: blueprint declarative-http-tests
2015-02-03 13:03:39 +00:00
Can ZHANG dd772619e8 Eliminate unnecessary search for test cases
As all unit tests lie in `ceilometer/ceilometer/tests`,
the test_command should use `ceilometer/tests` instead of `ceilometer`.

Change-Id: Idb1dade44a06c71fb5e64ca875b71633def110a5
Closes-Bug: 1368509
2014-09-16 14:21:37 +08:00
Nejc Saje 84b228410e Fix tests with testtools>=0.9.39
NOTE: the RPC module that was causing problems in Icehouse no longer
exists in master, but the fix should be in the master as well to avoid
future problems.

'rpc_backend' config option in
ceilometer.openstack.common.rpc.__init__.py defaults to
'%s.impl_kombu' % __package__. Because the RPC module is imported
in some other files as ceilometer.openstack.common.rpc, rpc_backend
is set to 'ceilometer.openstack.common.rpc.impl_kombu'. But when
the test loader tries to import the RPC module as openstack.common.rpc
(since it is starting inside the ceilometer folder), registering the
option fails, because we try to register a different default value.

The issue surfaced because testtools==0.9.39 started checking __init__.py
files as well. It is fixed by passing a top-level directory parameter to
the test discovery process.

(cherry picked from commit 7ff220fc5cb4dad616b27ea6762653054df00139)

Conflicts:
	.testr.conf

Change-Id: I08036b54def3eb496772bcf183927b9f70bb7a86
Closes-bug: #1365613
2014-09-08 10:57:40 +02:00
Mehdi Abaakouk 401b9743c9 Reenables the testr per test timeout
This change reenables the testr per test timeout, but set the value to
10 minutes, a gate job take 5-8 minutes, so test should not take more
than 10 minutes.

Change-Id: Ifccef9040529ec1a0b21076ed17d91a4f9737096
2014-06-18 09:49:11 +00:00
Mehdi Abaakouk f35a9a6b8c Removes per test testr timeout
Because testr run tests in parallel and we use fake driver of
oslo.messaging to make unittests and this one use time.sleep() monkey
patched by eventlet, a test can take a lot of time, just because
eventlet have decided to run other tests before instead of finish the
started one.

So, just remove the per test testr timeout, like we have before.

Change-Id: I26f14937a16b23428f55fc7f42b4066b398c06a8
Closes-bug: #1323524
2014-06-09 19:43:23 +02:00
Mehdi Abaakouk 7a2a8b82b2 Update testrepository configuration
This change is a copy of nova testrepository configuration file.

Since we use oslo.test we can now record the stdout and stderr of each
test and print them only is a test fail. This also ensure the printed
log is located into the failing tests.

It also sets a timeout of 160 for each test instead of waiting
indefinitely.

Change-Id: If8e847643d7812a3e595faff171cdc094f5642f4
2014-05-23 17:45:08 +02:00
Julien Danjou 36955618ae Move tests into ceilometer module
Doing this allow for potential importing of the tests and is cleaner
than having a side directory. Nova already does this, so let's move.

Change-Id: I77fc9c5356f3962363fd355b8dbf44fbeec157ee
2013-11-13 15:32:31 +01:00
Angus Salkeld 1a723a05c7 Replace nose with testr
- add .testr.conf (in base dir and nova_tests)
- remove all references to nose
- adjust paths: A couple of tests would assume the current directory
  was ./tests/ but it is now ./
- don't run the tests in parallel as the db tests have one connection
  per test class.

nova_tests hackery:
It seems testtools/testr imports everything and I just don't see a way of
running things in tests/ and nova_tests/ seperately but in one .test.conf.
So if you want to use testr directly you will need to:
 testr run
 cd nova_tests
 testr run

part of bug 1177924
Change-Id: I41875dcf94463fa5f9c07a7840c37089226c59ad
2013-05-18 18:06:38 +10:00