Files
42d91ebee0a2b162d9711be5e8b5a04486d63a63
nova /HACKING.rst

119 lines
5.8 KiB
ReStructuredText
Raw Normal View History

2010年05月27日 23:05:26 -07:00
Nova Style Commandments
=======================
2010年05月27日 23:05:26 -07:00
---------------------------
2011年07月29日 12:49:48 -04:00
datetime.datetime.utcnow() to make it easy to override its return value in tests
Code that needs to be shared between virt drivers should be moved
into a common module
- [N312] using config vars from other virt drivers forbidden
Config parameters that need to be shared between virt drivers
should be moved into a common module
Config parameter help strings should have a capitalized first letter
- [N314] vim configuration should not be kept in source files.
assertIsInstance(A, B).
- [N317] Change assertEqual(type(A), B) by optimal assert like
assertIsInstance(A, B)
assertIsNone(A)
self.flags(option=value) instead.
assertIn/NotIn(A, B, message)
assertEqual(A in B, False) or assertEqual(False, A in B) to the more specific
assertIn/NotIn(A, B)
-------------------
For every new feature, unit tests should be created that both test and
(implicitly) document the usage of said feature. If submitting a patch for a
bug that had no unit test, a new passing unit test should be added. If a
submitted bug fix does have a unit test, be sure to add a new one that fails
without the patch and passes with the patch.
For more information on creating unit tests and utilizing the testing
Running Tests
-------------
The testing system is based on a combination of tox and testr. The canonical
create virtual environments, populate them with dependencies and run all of
to install. Please refer to doc/source/devref/development.environment.rst for
a list of those packages on Ubuntu, Fedora and Mac OS X.
the class name containing the tests as an extra ``tox`` argument;
e.g. ``tox -- TestWSGIServer`` (note the double-hypen) will test all
WSGI server tests from ``nova/tests/test_wsgi.py``; ``--
TestWSGIServer.test_uri_length_limit`` would run just that test, and
``-- TestWSGIServer|TestWSGIServerWithSSL`` would run tests from both
classes.
you have created, or it is possible that you have all of the dependencies
installed locally already. In this case, you can interact with the testr
run --parallel`` will run it in parallel (this is the default incantation tox
http://wiki.openstack.org/testr
-------------
do this via ``tox``, simply run ``tox -evenv -- python setup.py build_sphinx``,
which will cause a virtualenv with all of the needed dependencies to be
created and then inside of the virtualenv, the docs will be created and
put into doc/build/html.
If you'd like a PDF of the documentation, you'll need LaTeX installed, and
additionally some fonts. On Ubuntu systems, you can get what you need with::
apt-get install texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
tox -evenv -- python setup.py build_sphinx_latex
cd build/sphinx/latex
make
You should wind up with a PDF - Nova.pdf.