diff --git a/doc/source/dev/dev-quickstart.rst b/doc/source/dev/dev-quickstart.rst index 98d98560b6..814ed42b3b 100644 --- a/doc/source/dev/dev-quickstart.rst +++ b/doc/source/dev/dev-quickstart.rst @@ -5,7 +5,7 @@ Developer Quick-Start ===================== This is a quick walkthrough to get you started developing code for Ironic. -This assumes you are already familiar with submitting code reviews to +This assumes you are already familiar with submitting code reviews to an OpenStack project. .. seealso:: @@ -37,7 +37,10 @@ Setting up a local environment for development can be done with tox:: # activate the virtualenv source .tox/venv/bin/activate - # run testr init + # install requirements within the virtualenv + pip install -U -r requirements.txt test-requirements.txt + + # initialize testr testr init To run the pep8/flake8 syntax and style checks:: @@ -47,10 +50,110 @@ To run the pep8/flake8 syntax and style checks:: To run Ironic's unit test suite:: - # run unit tests + # run all the unit tests testr run -When you're done, to leave the venv:: + # to run specific tests only, specify the file, module or test name, eg: + testr run test_conductor + +When you're done:: # deactivate the virtualenv deactivate + +=============================== +Exercising the Services Locally +=============================== + +If you would like to exercise the Ironic services in isolation within a local +virtual environment, you can do this without starting any other OpenStack +services. For example, this is useful for rapidly prototyping and debugging +interactions over the RPC channel, testing database migrations, and so forth. + +First, install prerequisites:: + + # install rabbit message broker + # Ubuntu/Debian: + sudo apt-get install rabbitmq-server + + # Fedora/RHEL: + sudo yum install rabbitmq-server + + # install ironic CLI + sudo pip install python-ironicclient + +Then, activate the virtual environment created in the previous section, and run +everything else within that:: + + # enter the ironic directory + cd + cd ironic + + # activate the virtualenv + source .tox/venv/bin/activate + + # install ironic within the virtualenv + python setup.py develop + + # initialize the ironic database; this defaults to storing data in + # ./ironic/openstack/common/db/ironic.sqlite + ironic-dbsync + + # copy sample config and modify it as necessary + cp etc/ironic/ironic.conf.sample etc/ironic/ironic.conf.local + cat >> etc/ironic/ironic.conf.local <