Community mailing list archives
Re: The Speed of UnitTestsby
Vauxoo S.A. de C.V., Nhomar Hernandez
On Wed, Aug 17, 2016 at 3:17 AM, Jairo Llopis <firstname.lastname@example.org> wrote:
2016-08-16 17:42 GMT+02:00 Nhomar Hernandez <email@example.com>:Can you point us where? no there are such things as "Odoo;s speeder" you need to point to the specific action which you considere slow in order to put a proper issue there.I hope I could, but identifying bottlenecks would require many hours of R&D. This must be done by Odoo SA itself.What I was meaning with my comment is that, if testing all modules takes 103 seconds, but preparing the environment takes 13 minutes, then the problem is not in the tests, but in the framework (that maybe includes Postgres, not sure)
well that's a quick hipothesis (which is that, 'just' an hypothesis) BTW, if you measure the inner points in your environment you can measure every part by yourself.
We did it, set an environment all those 13 minutes is Postgresql + set the base database + other magic, in our test environments on CI it is like 8/10 minutes (we manage the R&D by ourself) and it is due to the test framework itself (as I said it is integration tests not only unittests).
But BTW that do not MUST be by anybody,that "should be" done by the people that need the change (in our case when we find a performance problem we attack that with our enterprise and work with odoo side/by/side we expend A LOT of time in R&D case) as you mentioned this time must be paid and covered and that's why the enterprise comes alive and/or the community work, nobody has any dutie until an exchange of responsability with a commercial agreement is set (either you-your customer, you-you, you-odoo-customer....).
As you read in the licence (and in any other opensuource project) it comes without any responsibility and it is distributed as it is.
But BTW if you dedicate a while to an specific topic and put such specific conclusion on github this will help more than claim right and duties on others, don't you think?
2016-08-16 18:02 GMT+02:00 David Arnold <firstname.lastname@example.org>:I think, a further distinction throughout the framework between unit tests and integration tests is warranted. While unit tests MUST not depend on data files, integration tests possibly can but should avoide that. Having this distinction, one could optionally get rid of the data loading part as well by a flag. I hope Odoo testing engineers happen to read this thread.Actually creating records by reading data files or by hardcoding the record creation in the test itself should not make much difference.
It makes but again, it depends of what are you testing and where, we need details there is not such thing as the "Performance Panacea".
We introduce some performance measures in our test environments (already in mqt under oca/umbrella) but measure them and test an specific environment exactly as you mentioned must be paid.
OTOH, I'm not sure I want a different DB backend in my tests and in my production environment, given tests are supposed to imitate the production environment as close as possible, where data files are loaded and Postgres is used.
I do not understand this, odoo is data driven and you have only one backend.....
If you could, however, use in-memory Postgres transactions, that would get what you want: skip hard disk.
We did (this put down 3 minutes the time in a 1 hour test environement we put back to disk but no remember why)
Or simply buy a fast SSD.
We did also 2 minutes down in 1 hour environment.