[openstack-dev] [nova][documentation][devstack] Confused about how to set up a Nova development environment

Mike Spreitzer mspreitz at us.ibm.com
Thu Jan 9 08:19:26 UTC 2014


I am trying to become a bit less of a newbie, and having a bit of 
difficulty with basics.  Following are some questions, and reviews of the 
relevant documentation that I have been able to find (I am trying to 
contribute to documentation as well as solve my setup problems).  My 
driving question is: how do I set up a development environment?  Included 
is this question: what sort(s) of testing should I plan on doing in this 
environment?  And: what sorts of testing does OpenStack define?

I started at http://www.openstack.org/ and looked at the links in the 
"Documentation" section of the footer and also followed the Documentation 
link in the header.  Those lead to 
https://wiki.openstack.org/wiki/HowToContribute and 
http://www.openstack.org/software/start/ --- which give different answers 
to my question.  The nova project itself has a top level file named 
HACKING.rst that gives yet another answer regarding testing.  I have found 
mentions of "unit", "functional", and "operational" testing, but have not 
found any page that sets out to list/define all the categories of testing; 
should there be?


=================================================
https://wiki.openstack.org/wiki/HowToContribute
=================================================

The HowToContribute page's most relevant links are to 
https://wiki.openstack.org/wiki/GerritWorkflow and 
https://wiki.openstack.org/wiki/GettingTheCode .  GerritWorkflow says I 
should run unit tests, but does not describe how; it tells me I can get 
the code by doing a `git clone` but says nothing more about setting up my 
environment for running and testing.

Getting_The_Code is more expansive.  In addition to telling me how to `git 
clone` a project, it also takes a stab at telling me how to get the 
dependencies for Nova and for Swift; what are people working on other 
projects to do?  I looked into the Nova remarks.  There are two links: one 
for Ubuntu (https://wiki.openstack.org/wiki/DependsOnUbuntu) and one for 
MacOS X (https://wiki.openstack.org/wiki/DependsOnOSX).  Those two are 
surprisingly different.  The instructions for the Mac are quite simple: 
`python tools/install_venv.py` and `./run_tests.sh`, plus one more command 
to install RabbitMQ if I want to support running more than the unit tests. 
 The instructions for Ubuntu, on the other hand, are much lengthier and a 
bit less ambitious (they seem to end with the unit tests, no discussion of 
more general running).  Why the difference?  Why should 
tools/install_venv.py not be used on Ubuntu?

Are the instructions for MacOS X for real?  Looking in the "Install 
OpenStack" section of http://docs.openstack.org/ I see no hint that 
OpenStack can run on MacOS X.  Perhaps those instructions make sense 
because the unit tests should actually work on MacOS X?  (I tested that, 
and got 8 failures in the nova unit tests on my Mac.)

https://wiki.openstack.org/wiki/HowToContribute also refers to a video (
http://www.youtube.com/watch?v=mT2yC6ll5Qk&feature=youtu.be), and the 
video content shows several URLS:

http://wiki.openstack.org/GitCommitMessages
http://wiki.openstack.org/HowToContribute
http://wiki.openstack.org/DevQuickStart
http://www.scribd.com/doc/117185088/Introduction-to-OpenStack
http://docs.openstack.org/
http://devstack.org/

The most interesting-looking one of those that does not appear elsewhere, 
http://wiki.openstack.org/DevQuickStart, is now content-free.

I myself would feel more comfortable if I could run more than unit tests 
in my development environment.  I would like to go all the way to some 
full system tests.


=================================================
http://www.openstack.org/software/start/
=================================================

http://www.openstack.org/software/start/ leads directly to 
http://devstack.org/ --- which is surprising because it skips over the 
OpenStack wiki page (https://wiki.openstack.org/wiki/DevStack) that 
introduces DevStack.  The wiki's page gives a mission statement and 
description for DevStack.  The mission statement is "provide and maintain 
tools used for the installation of the central OpenStack services from 
source suitable for development and operational testing"; the description 
is "an opinionated script to quickly create an OpenStack development 
environment".  Reading the text literally, it does not define what sort(s) 
of testing are included in "development".  Since GerritWorkflow told me 
that the normal workflow includes unit tests, I could reasonably conclude 
that DevStack sets me up to run unit tests.  In particular, one could take 
these remarks to mean that DevStack will install the dependencies listed 
in test-requirements.txt.  But that is not actually true.

I tested a DevStack install, and found it gave me a nova/.git connected to 
the nova project at git.openstack.org (one could take this as implied by 
the remarks that DevStack sets up a development environment).  I presume I 
can enhance this with the more personal parts of the Gerrit client setup 
described in the GerritWorkflow page.

Once I install DevStack, and have a running OpenStack installation, can I 
then modify code and run unit tests?  I worry that either or both could 
interfere with the running OpenStack.  I have not noticed DevStack 
documentation speaking to this issue.  And, of course, I eventually want 
to get the running OpenStack to use my modified code.


=================================================
HACKING.rst
=================================================

The nova project's HACKING.rst file says

The testing system is based on a combination of tox and testr. The 
canonical approach to running tests is to simply run the command ``tox``.

Neither of the other two answers mentioned tox and testr.  I see that 
nova/run_tests.sh uses testr, and not tox.  The .venv created by 
nova/tools/install_venv.sh does not have a tox command, and neither does 
the nova/.venv created by DevStack.


Thanks,
Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140109/bdf830ee/attachment.html>


More information about the OpenStack-dev mailing list