[Erp5-dev] testing with transactions and activities

bartek bartek at gorny.edu.pl
Fri Nov 12 13:54:28 CET 2010


I recently found to serious issues which seem to have slipped through
unnoticed, despite a massive test suite running every night, testing
every corner of ERP5. I'm beginning to have an impression that there is
a fundamental shortcoming in the whole testing system. Every test I've
seen (disclaimer: there are plenty of tests which I have not seen, so I
may be completely wrong here) explicitly commits a transaction and then
executes self.tic() after anything it did. So there is no way it could
possibly detect things like the two I reported recently. Maybe apart
from testing like:

self.doSomething()
get_transaction().commit()
self.tic()
...check...

we should also test like:

self.doSomething()
self.tic()
get_transaction().commit()
self.tic()
...check...

and
self.doSomething()
get_transaction().commit()
self.doAnotherThing()
get_transaction().commit()
self.tic()
...check...

This would bring the test scenarios closer to a real-life, multi-user,
heavily used environment.

Bartek



More information about the Erp5-dev mailing list