watcher/doc/source/contributor/testing.rst
ShangXiao abb9155eb4 Fix old url links in doc
Replace the old http url links with the lastest https ones according
to the official OpenStack website.

Change-Id: I1abd79bb80dae44ee2ba5946b8a375c7096b39d6
2018-02-23 00:19:24 -08:00

1.5 KiB

Testing

Unit tests

All unit tests should be run using tox. To run the same unit tests that are executing onto Gerrit which includes py35, py27 and pep8, you can issue the following command:

$ workon watcher
(watcher) $ pip install tox
(watcher) $ cd watcher
(watcher) $ tox

If you want to only run one of the aforementioned, you can then issue one of the following:

$ workon watcher
(watcher) $ tox -e py35
(watcher) $ tox -e py27
(watcher) $ tox -e pep8

You may pass options to the test programs using positional arguments. To run a specific unit test, you can pass extra options to os-testr after putting the -- separator. So using the -r option followed by a regex string, you can run the desired test:

$ workon watcher
(watcher) $ tox -e py27 -- -r watcher.tests.api

When you're done, deactivate the virtualenv:

$ deactivate

Tempest tests

Tempest tests for Watcher has been migrated to the external repo watcher-tempest-plugin.