Working with the Source

Setting up a Development Sandbox

  1. Set up a server or virtual machine to run OpenStack using devstack.
  1. Clone the ceilometer project to the machine:

    $ cd /opt/stack
    $ git clone https://git.openstack.org/openstack/ceilometer
    $ cd ./ceilometer
  2. Once this is done, you need to setup the review process:

    $ git remote add gerrit ssh://<username>@review.openstack.org:29418/openstack/ceilometer.git
  3. If you are preparing a patch, create a topic branch and switch to it before making any changes:

    $ git checkout -b TOPIC-BRANCH

Running the Tests

Ceilometer includes an extensive set of automated unit tests which are run through tox.

  1. Install tox:

    $ sudo pip install tox
  2. Install the test dependencies:

    $ sudo pip install -r /opt/stack/ceilometer/test-requirements.txt
  3. Run the unit and code-style tests:

    $ cd /opt/stack/ceilometer
    $ tox -e py27,pep8

    As 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.v2

To debug tests (ie. break into pdb debugger), you can use ‘’venv’’ command:

$ tox -e venv "python -m unittest discover ceilometer"

Unfortunately, debugging currently has some limitations: You cannot run a specific test, you have to launch the whole test suite.

See also

Code Reviews

Ceilometer uses the OpenStack review process for all code and developer documentation contributions. Code reviews are managed through gerrit.

Table Of Contents

Previous topic

Areas to Contribute

Next topic

Writing Agent Plugins

This Page