6
The recipe is currently hosted as a launchpad project, under Bazaar
7
version control: https://launchpad.net/anybox.recipe.openerp
9
We follow the standard launchpad workflow (bugs, merge requests…).
10
Code contributors are systematically added to the list of
11
contributors at the end of the README, unless they explicitely wish
12
not to (what Launchpad does is obvisouly out of our scope).
14
There are currently no branch naming rules.
16
Members of the "Anybox" team have push privileges on the main branches.
18
Using a development version
19
~~~~~~~~~~~~~~~~~~~~~~~~~~~
21
To use a local version of the recipe, you may use the ``develop``
22
general buildout option::
25
develop = /path/to/anybox.recipe.openerp
27
To track the latest version of a ``bzr`` branch of the recipe, we find
29
`gp.vcsdevelop <https://pypi.python.org/pypi/gp.vcsdevelop>`_
30
extension simple and useful. Here's an example (excerpt from
31
``buildot/recipe-trunk.cfg``)::
34
extensions = gp.vcsdevelop
35
vcs-extend-develop = bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anybox.recipe.openerp
39
Actually some parts of the recipe are aware of the possible use
40
of ``gp.vcsdevelop`` for python dependencies, and special care of it is
41
taken in the freeze and extract features. This is known to work even
42
for ``zc.buildout`` itself.
47
We recommend "developping" the source code in a virtualenv, together
48
with ``bzr``. For instance::
51
recipe-env/bin/pip install bzr
52
recipe-env/bin/bzr branch lp:anybox.recipe.openerp
53
cd anybox.recipe.openerp
54
python setup.py develop
59
The recipe follows the same strong code development coding principles
60
as many other projects:
62
* Style enforcement : we follow the PEP8 guidelines
63
* Static analysis with `flake8 <https://pypi.python.org/pypi/flake8>`_
64
(combines conveniently `pep8 <https://pypi.python.org/pypi/pep8>`_
65
and `pyflakes <https://pypi.python.org/pypi/pyflakes>`_).
66
* Unit tests : we try and test as much as possible. It is hard to achieve a
67
real 100% with a tool that calls so many external processes, but
68
this is mitigated by our
69
:ref:`continuous integration <continuous_integration>` practice of
70
doing real OpenERP installations with the latest revision of the recipe.
72
Launching static analysis and unit tests
73
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75
Install ``nose``, ``flake8`` and, optionally, ``coverage``::
77
recipe-env/bin/pip install nose coverage flake8==2.0 \
78
pep8=1.4.6 mccabe==0.2.1 pyflakes==0.7.3 nose
81
.. note:: we've had problems lately with discrepancies in ``pep8``
82
versions, that's why versions of ``flake8`` and its
83
dependencies are fixed above. In case of doubt, check what
84
the buildbot is actually running.
86
Run ``flake8`` and the tests::
88
cd anybox.recipe.openerp
89
flake8 anybox && nosetests anybox --with-doctest
91
There is also this convenience to run the tests and output a coverage report::
96
.. _integration tests:
101
There is a special category of tests: those that need a real OpenERP
102
instance, built with the recipe, to run.
104
They are located within the ``tests_with_openerp`` subdirectory and
105
need to be launched with a launcher script constructed by the recipe.
107
For example, create a testing buildout like this::
110
# version as you wish
112
openerp_scripts nosetests command-line-options = -d
114
Then run ``bin/buildout``, create a database and initialize it. From
115
the buildout directory::
118
bin/start_openerp -d test-recipe -i base --stop-after-init
120
You can then run the tests::
122
bin/nosetests_openerp -d test-recipe -- /path/to/recipe/branch/tests_with_openerp
124
Currently, these tests are all about the ``Session`` objects, used in
127
.. note:: you may use a different version of the recipe to build that
128
testing buildout. This is anyway what happens if you build
129
with your development version, and hack some changes
132
Using a very different version of the recipe could give
133
funky results, but you're supposed to know what you're doing
137
.. _continuous_integration:
139
Continuous integration
140
~~~~~~~~~~~~~~~~~~~~~~
145
Upon each push on the main branches, Anybox' public
146
buildbot awakes to check the coding style, run the tests and build
147
this documentation. You may check the status there:
150
<http://buildbot.anybox.fr/waterfall?show=anybox.recipe.openerp>`_
152
<http://buildbot.anybox.fr/waterfall?show=anybox.recipe.openerp-stable>`_
157
Furthermore, this buildbot instance runs `anybox.buildbot.openerp
158
<https://pypi.python.org/pypi/anybox.buildbot.openerp>`_,
159
a buildbot configurator for OpenERP installations based on the recipe.
161
This is used in turn to run high-level integration tests, having the
162
latest bzr version of the recipe actually install several combinations
163
of OpenObject server and addons, and run their unit tests.
165
The configuration is stored in the ``buildbot`` subdirectory of the
166
recipe trunk branch. It is made of a high level configuration file
167
(``MANIFEST.cfg``) and buildout configuration files. This buildbot
168
instance actually aggregates several such configurations.
170
The corresponding builders are those whose name starts with
171
``recipe-`` or ``stable-recipe-`` in the `builders list
172
<http://buildbot.anybox.fr/builders>`_.
174
.. note:: the `integration tests`_ mentioned above are executed in
175
particular during this process, currently in the
176
``recipe-7.0-postgresql-9.2`` builder.
178
Some builds may appear to be broken because of tests failures been
179
pushed by upstream in OpenERP itself or in the tested addons, but it's
180
easy to check whether this is due to a recipe failure or not.
184
Anybox hardware resources are limited; contributing buildslaves would
185
be greatly appreciated.