Skip to content
Pall Sigurdsson edited this page Jul 9, 2013 · 18 revisions

This document contains some quick notes that are needed to get started with developing in Adagios.

Code style

Adagios python code should more or less conform with PEP8, although line length up to 120 chars is common and no plans to change that.

Setting up your dev environment

Make sure you have all the dependencies installed on your machine and optimally have gotten adagios to work. You will need a set of nagios configuraiton under /etc/nagios but if you are not working on the status views it should be optional to have nagios installed and running.

# Clone our repo
git clone http://github.com/opinkerfi/adagios.git

# Start the django web server
cd adagios/adagios
python manage.py runserver

Testing

Most of the complex code logic lies in underlying libraries like pynag.

We use Django's unit tests for smoke-testing views. Please do not commit your code if you break any of the unit tests.

Unit tests themselves live within every django app so for examples tests for the status module live in /status/tests.py. You can run the unit tests from the command line with:

python manage.py test
Creating test database for alias 'default'...
.................
----------------------------------------------------------------------
Ran 17 tests in 2.906s

OK
Destroying test database for alias 'default'...

If you create any new views, you are also responsible for creating unit tests for them.