Files
5d6e0086b578077e7479b78e282e3f7da7ffca71
nova /HACKING.rst

123 lines
6.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.
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
the class name containing the tests as an extra ``tox`` argument;
e.g. ``tox -- TestWSGIServer`` (note the double-hypen) will test all
``-- 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
-------------
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 and ImageMagick
installed, and additionally some fonts. On Ubuntu systems, you can get what you
need with::
Then you can then use the ``build_latex_pdf.sh`` script in tools/ to take care
output pdf to Nova.pdf in that directory.