On 12 May 19:07, Albert Cervera i Areny wrote: > 2014-05-12 18:07 GMT+02:00 Cédric Krier <cedric.kr...@b2ck.com>: > > On 12 May 18:00, Sergi Almacellas Abellana wrote: > >> El 12/05/14 17:28, Cédric Krier ha escrit: > >> >Hi, > >> > > >> >There is a problem with the new tests added to purchase (see > >> >http://tests.tryton.org/~test/postgresql.html). > >> >The test fails when running with account_stock_continental because this > >> >module add a constraint on product account stock. > >> We have this problem too with modules that add constraints to models, and > >> breaking more than one module, and we are trying to find a more generic > >> solution. > >> >I wrote a patch:http://codereview.tryton.org/13311003 > >> >but I'm not sure it is the right way to go. > >> >An other possibility would be to remove the required of > >> >account_stock_continental for bad design reason (there are still the > >> >*_used which raise error message). > >> > > >> >What do you think? > >> I think it's better to make tests that doesn't take in account other > >> existing modules, so i will be better if we can get rid of the constraint. > >> > >> May dropping and recreating the db should do the trick? > > > > Running tests for 1 kind of database already takes 4 hours if we do what > > you suggest it will take about 2 weeks. > > Maybe we could cache the database depending on module dependencies. That is: > > Module B depends on A and module C also depends on A (but does not depend on > B). > > So after running tests of A we cache that database. When running B > tests we pick the database from cache and run the tests on it. When > running C tests we also pick the database from cache and run the tests > on it.
That's become very complex. Indeed, the current test implementation was based on the idea that module should be independent if they are not dependent. And so with the current design it will show when it is not the case and it should be fixed. So here, the module account_stock_continental has a side effect because it adds required fields on product. When other modules like sale or purchase does it, they do it in a independent way because the requirement depend on a flag. I'm wondering if instead of my current patch, we should not add a flag on product (or on configuration model) to activate the stock accounting. It will remove the side effect of the account_stock_continental. -- Cédric Krier - B2CK SPRL Email/Jabber: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/
pgpAqwz2LJLQH.pgp
Description: PGP signature