Commit Graph

8 Commits

Author SHA1 Message Date
Matthew Treinish 9c56c78513
Finish stestr migration
Nova switched to using stestr for all it's in tree testing except for
the coverage job. This commit updates that job so it also uses stestr
and cleans up the last bits of testr setup left in tree. As part of
this change this moves all the one off per job configuration into the
tox job definitions instead of hiding it in either the .stestr.conf or
in a wrapper script.

Change-Id: I36e0e791d485b44641a1ed8770eca8e95aca19be
2017-11-24 16:51:12 -05:00
Chris Dent 5f887d851e [placement] Adjust the name of the gabbi tests
Recently there was some confusion caused by the fact the gabbi tests
used by the placement API have names like this:

    gabbi.suitemaker.test_placement_api_usage_create_provider

This means that the names cannot be matched against tox interactions
like:

    tox -efunctional -- nova.tests.functional.api.openstack

This change makes it so the tests are generated with names like:

    nova.tests.functional.api.openstack.placement.test_placement_api.usage_create_provider

So this change is submitted for review if people care. The other
option is to:

    tox -efunctional placement

gabbi was updated to allow this functionality in a clean form, so
this depends on a change to global requirements but can work
without it if required.

Depends-On: Ie93c0e680a80fc7f157e2b5b9dfc2ab17f934f10
Change-Id: I8579bf7529a7298c4d049e47cc3cde1731a5e666
2016-09-20 19:14:44 +00:00
Chris Dent 2ae10ce522 Add initial framing of placement API
The placement API will initially host resource provider
information and then will grow to provide a full placement
service. Eventually it will be fully extracted from Nova.

To facilitate that extraction, this service is being developed
with few ties to existing nova.wsgi structures. Instead it
uses relatively plain WSGI apps that are:

* uses the Routes library with declarative mapping defined in
  ROUTE_DECLARATIONS
* basic wsgi apps, with webob and the request class, for each handler
  define as functions
* does not use a paste-ini file to compose middleware, instead code
  which minimally inspects the oslo config to know how to adjust
  middleware (in the initial case choosing an auth_strategy)

Many of these "features" will be demonstrated in commits that
follow this one that enable specific behaviors for resource
providers and their inventories.

In order to ensure that this change can be merged in an atomic
fashion it includes microversion support that was previously in its
own commit.

The microversion_parse library is used in a WSGI middleware
to parse incoming microversion headers and place the
determined value into the WSGI environment at the
'placement.microversion' key. Response headers are adjusted to
add the required outgoing headers as described in:

http://specs.openstack.org/openstack/api-wg/guidelines/microversion_specification.html

If a client requests an invalid microversion, they will receive
a 400 response. If the microversion is of a valid form but not
available, they will received a 406 response. The format of that
response is dependent on the accept header of the request. If it
is JSON, the min and max available microversions are presented.

A request to '/' will return version discovery information.

Thus far nothing else is done with the microversion information.
It is there for when we need it in the future. For now everything
is version 1.0.

The groundwork for using gabbi to test the API is in place in
nova/tests/functional/api/openstack/placement. The gabbi tests
are included in the functional target. To run just the placement
tests it is possible to run 'tox -efunctional placement'.

Change-Id: Icb9c8f7a1fa8a9eac66c2d72f4b7e4efd4e1944f
Partially-Implements: blueprint generic-resource-pools
2016-07-29 10:31:36 +00:00
Sean Dague 5c8bbaafef Add tox -e functional
Provide a tox -e functional stub, as a place for functional tests to
migrate to. This will allow us to write a zuul test configuration for this
environment.

Part of bp:functional-tests-for-nova

Change-Id: I8a1107beab151f9bf574cfbae1d4dc18400fd74e
2014-11-12 15:31:06 -05:00
Joshua Hesketh cf99852f51 Fix tests to work with mysql+postgres concurrently
Optimise tests.db.test_migrations and tests.db.test_migration_utils for
concurrency and make opportunistic tests obey walk_style configurations.

Closes-Bug: 1207750

Change-Id: Idb30f144fb67aefc58749897d774103c3c0ec640
2013-10-27 09:46:45 +11:00
Roman Podolyaka e4b85c10a6 Make testr preserve existing OS_* env vars values
Values for OS_TEST_TIMEOUT, OS_STDOUT_CAPTURE and OS_STDERR_CAPTURE
environment variables are fixed in .testr.conf now. It should be possible
to override them for each tox/runtests.sh call or for the current shell
session without making changes to .testr.conf.

Fixes bug 1182416.

Change-Id: I6c7839fa78b53ac8ea358ce0143a00931da96a9e
2013-05-29 11:55:49 +03:00
Clark Boylan 7224fde0f0 Invert test stream capture logic for debugging.
Previously the default test behavior was to capture stdout and stderr.
Make the new default to not capture stdout and stderr then set
.testr.conf to always capture these streams when running tests under
testr.

The motiviation behind this change is that you will want these streams
to be captured when running under testr, but when not running under
testr you may not want to capture them. An example of this would be
running `python -m testtools.run test_name` with a change to test_name
to invoke the python debugger (capturing stdout and stderr interferes
with normal debugger functionality).

Also, only invoke the test timeout by default when running under testr.
This is done for the same reason as above. When running a test under the
debugger the timeout interferes with debugging.

Change-Id: I42cbbdadb2f221ec439e92a6800d14e8436bb77b
2013-01-07 11:03:30 -08:00
Clark Boylan 4abc8cc64f Use testr to run nova unittests.
Convert nova from using nosetests to testr for its test runner. Some
tests had to be modified to get them to run properly under testr.

run_tests.sh has been updated to run testr instead of nosetests.

Coverage is collected by running subunit.run under coverage.py when the
coverage environment is selected.

Note that you will need to rebuild your virtualenvs as nose is being
removed from the dependency lists and is being replaced by testr. Tests
will run in different processes once this test is merged so you cannot
use test classes to pass information between tests. Each test should be
a proper independent unit. Additionally the -x and -d flags to
run_tests.sh have been removed as there are currently no decent
approximations for those functions.

Change-Id: I019ca098972ca749b195f59968cf21edd5ba9109
2012-12-14 14:22:20 -08:00