Skip to content

Commit

Permalink
Document tox instead of run_tests.sh
Browse files Browse the repository at this point in the history
Change-Id: Ib4619240c27b0dfe861c9297b64e6d52cdde8944
Closes-Bug: 1244605
  • Loading branch information
dolph committed Oct 25, 2013
1 parent 8d2f53c commit 81e7713
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 21 deletions.
44 changes: 32 additions & 12 deletions doc/source/developing.rst
Expand Up @@ -120,25 +120,45 @@ Once run, you can see the sample data that has been created by using the
Running Tests
=============

To run the full suites of tests maintained within Keystone, run::
Before running tests, you should have ``tox`` installed and available in your
environment (in addition to the other external dependencies in :doc:`setup`)::

$ ./run_tests.sh
$ pip install tox

This shows realtime feedback during test execution, iterates over
multiple configuration variations, and uses external projects to do
light integration testing to verify the keystone API against other projects.
.. NOTE::

You may need to perform both the above operation and the next inside a
python virtualenv, or prefix the above command with ``sudo``, depending on
your preference.

To execute the full suite of tests maintained within Keystone, simply run::

$ tox

This iterates over multiple configuration variations, and uses external
projects to do light integration testing to verify the Identity API against
other projects.

.. NOTE::

The first time you run ``tox``, it will take additional time to build
virtualenvs. You can later use the ``-r`` option with ``tox`` to rebuild
your virtualenv in a similar manner.

To run tests for one or more specific test environments (for example, the most
common configuration of Python 2.7 and PEP-8), list the environments with the
``-e`` option, separated by spaces::

$ tox -e py27,pep8

See ``tox.ini`` for the full list of available test environments.

Test Structure
--------------

``./run_test.sh`` uses its python cohort (``run_tests.py``) to iterate
through the ``keystone/tests`` directory, using Nosetest to collect the tests
and invoke them using an OpenStack custom test running that displays the tests
as well as the time taken to run those tests.

Not all of the tests in the tests directory are strictly unit tests. Keystone
intentionally includes tests that run the service locally and drives the
entire configuration to achieve basic functional testing.
intentionally includes tests that run the service locally and drives the entire
configuration to achieve basic functional testing.

For the functional tests, an in-memory key-value store is used to keep the
tests fast.
Expand Down
24 changes: 15 additions & 9 deletions keystone/tests/test_sql_upgrade.py
Expand Up @@ -15,16 +15,22 @@
# under the License.
"""
To run these tests against a live database:
1. Modify the file `keystone/tests/backend_sql.conf` to use the connection for
your live database
2. Set up a blank, live database.
3. run the tests using
./run_tests.sh -N test_sql_upgrade
WARNING::
Your database will be wiped.
Do not do this against a Database with valuable data as
all data will be lost.
1. Modify the file ``keystone/tests/backend_sql.conf`` to use the connection
for your live database
2. Set up a blank, live database
3. Run the tests using::
tox keystone.tests.test_sql_upgrade
WARNING::
Your database will be wiped.
Do not do this against a database with valuable data as all data will be
lost.
"""

import copy
import json
import uuid
Expand Down

0 comments on commit 81e7713

Please sign in to comment.