Community: Framework mailing list archives

Re: Speed of the tests in v8

Leonardo Pistone
- 01/21/2016 11:40:24

a few things already exist:

- the anybox recipe can generate wrappers to run scripts that will be
able to import openerp with all the modules loaded correctly. In the
doc of the recipe you should find an example for nose. That way you
have all the options of nose (including running only one test, or the
one that failed). Moreover, there is no module update. Test output is
printed directly and it is not messed up by the odoo logging system,
which is also great. This works with existing unittests.

If you don't use the anybox recipe, in v8/v9 you should be able to run
something similar to the "odoo shell" (i.e. load the modules and
create en environment and a registry) and then run your tests with
nose or something like that.

- Xavier Morel worked on this unmerged PR:

On Thu, Jan 21, 2016 at 5:22 PM, Nicolas Schmitt
<> wrote:
> Hi all,
> Abstract
> ========
> I am using Odoo v8, and I am looking for a way to speed up the python
> unit testing.
> When I work on a test case on a module with many dependent modules,
> testing takes too much time (around 17 seconds).
> What I would like
> ============================
> The possibility to test only one file, even though it may require
> updating the module.
> What I would really like
> =========================
> The possibility to use --test-file= without having to
> update anything.
> What I have discovered so far
> ==============================
> 1) My tests are working all right using:
> ./openerp-server -c  -d  --test-enable
>     -u
> 2) I have many errors using:
> ./openerp-server -c  -d  --test-file=
> 3) I have the same errors using:
> ./openerp-server -c  -d  --test-file=
>     -u
> References
> ==========
> The only thing I could find so far is this post by Alexandre Fayolle
> from 2013, without any answer:
> It is really similar to my problem, only that it seems to apply only to
> yaml files, and that the Odoo version seems not to be the 8th.
> The ultimate goal
> =================
> With the possibility to run only one test file, I would like to
> implement a way to trigger automatically the testing on model/views/test
> files
> modifications (maybe using watchdog?).
> Conclusion
> ==========
> If you know the answer to this particular problem, or if you have any
> kind of tips about facilitating testing, I would be grateful for your
> input.
> Also if you know things specific to Odoo 9, still good to know.
> I will then sum up all solutions/tips in an Odoo Forums post, so that it
> may serve to others.