Files
3c27e2c8f57d4be413e4766ebff2f12317bb903b
nova /HACKING.rst

106 lines
5.0 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.
- [N331] Change LOG.warn on LOG.warning.
assertIn/NotIn(A, B, message)
-------------------
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.
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.