Community mailing list archives
Re: The Speed of UnitTestsby
2016-08-16 11:02 GMT-05:00 David Arnold <firstname.lastname@example.org>:
I think Jairo has an argument. I've not gone that far to timetrack the remaining 13 y pico minutes, but there is a lot of disk involved, so I'll just suspect that. First there is need of a lot of reads per module to get data files loaded. Then there are quite some not so optimized database operation (see for example sqlalchemy with concept of work unit in order to see what I mean). I'm not sure, but I guess, by bringing @bwsandman's in memory sqlite3 mock to the next level (eg including an SQL Test Cursor into the core) could tremendously speed up at least the writing part of the above equation.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.
I do not know we run more that 1000 transactions per test but I will ask my team measure the exact number and give a feedback there.