The OpenStackClient team meets regularly on every Thursday. For details please refer to the OpenStack IRC meetings page.
Install the prerequisites for Tox:
On Ubuntu or Debian:
$ apt-get install gcc gettext python-dev libxml2-dev libxslt1-dev \
zlib1g-dev
You may need to use pip install for some packages.
On RHEL or CentOS including Fedora:
$ yum install gcc python-devel libxml2-devel libxslt-devel
On openSUSE or SUSE linux Enterprise:
$ zypper install gcc python-devel libxml2-devel libxslt-devel
Install python-tox:
$ pip install tox
To run the full suite of tests maintained within OpenStackClient.
$ tox
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.
OpenStackClient also maintains a set of functional tests that are optimally designed to be run against OpenStack’s gate. Optionally, a developer may choose to run these tests against any OpenStack deployment, however depending on the services available, results vary.
To run the entire suite of functional tests:
$ tox -e functional
To run a specific functional test:
$ tox -e functional -- --regex functional.tests.compute.v2.test_server
Using PDB breakpoints with tox and testr normally does not work since the tests fail with a BdbQuit exception rather than stopping at the breakpoint.
To run with PDB breakpoints during testing, use the debug tox environment rather than py27. For example, passing a test name since you will normally only want to run the test that hits your breakpoint:
$ tox -e debug openstackclient.tests.identity.v3.test_group
For reference, the debug tox environment implements the instructions
The documentation is generated with Sphinx using the tox command. To create HTML docs, run the commands:
$ tox -e docs
The resultant HTML will be in the doc/build/html directory.
The release notes for a patch should be included in the patch. See the Project Team Guide for more information on using reno in OpenStack.
If any of the following applies to the patch, a release note is required:
Reno is used to generate release notes. Use the commands:
$ tox -e venv -- reno new <bug-,bp-,whatever>
Then edit the sample file that was created and push it with your change.
To run the commands and see results:
$ git commit # Commit the change because reno scans git log.
$ tox -e releasenotes
At last, look at the generated release notes files in releasenotes/build/html in your browser.
If a developer wants to test new code (feature, command or option) that they have written, OpenStackClient may be installed from source by running the following commands in the base directory of the project:
$ python setup.py develop
or
$ pip install -e .
The import order shows below:
import copy
import fixtures
import mock
import os
from osc_lib.api import auth
from osc_lib import utils
import six
from openstackclient import shell
from openstackclient.tests import utils