- remove contributing folder contents
- move plugins into first level
- keep testing info from 'working with source' and move to first
level
- keep a generic contributing page to point to gerrit workflow and
standard links (git repo, launchpad, etc...)
- delete everything else
- split TOC into:
- overview - general stuff
- developer - dev related stuff
- appendix - random stuff
Change-Id: I8c460a655427141eb8bb8db9d4c2ecd253eb6cb1
2.7 KiB
Running the Tests
Ceilometer includes an extensive set of automated unit tests which are run through tox.
Install
tox:$ sudo pip install toxOn Ubuntu install
mongodbandlibmysqlclient-devpackages:$ sudo apt-get install mongodb $ sudo apt-get install libmysqlclient-devFor Fedora20 there is no
libmysqlclient-devpackage, so you’ll need to installmariadb-devel.x86-64(ormariadb-devel.i386) instead:$ sudo yum install mongodb $ sudo yum install mariadb-devel.x86_64Install the test dependencies:
$ sudo pip install -r /opt/stack/ceilometer/test-requirements.txtRun the unit and code-style tests:
$ cd /opt/stack/ceilometer $ tox -e py27,pep8As tox is a wrapper around testr, it also accepts the same flags as testr. See the testr documentation for details about these additional flags.
Use a double hyphen to pass options to testr. For example, to run only tests under tests/api/v2:
$ tox -e py27 -- api.v2To debug tests (ie. break into pdb debugger), you can use ''debug'' tox environment. Here's an example, passing the name of a test since you'll normally only want to run the test that hits your breakpoint:
$ tox -e debug ceilometer.tests.test_binFor reference, the
debugtox environment implements the instructions here: https://wiki.openstack.org/wiki/Testr#Debugging_.28pdb.29_TestsThere is a growing suite of tests which use a tool called gabbi to test and validate the behavior of the Ceilometer API. These tests are run when using the usual
py27tox target but if desired they can be run by themselves:$ tox -e gabbiThe YAML files used to drive the gabbi tests can be found in
ceilometer/tests/gabbi/gabbits. If you are adding to or adjusting the API you should consider adding tests here.