Trying to be a good little Agile/Extreme programmer, I've been writing a test suite as I work on the ping scanner. The "Virtual Plant" stuff is nice for modelling the whole network-level plant, that is, it makes the SNMP queries all seem to find modems and that kind of useful thing, but it doesn't help with modelling the PostgreSQL database that the code is querying to find each modem (which means that the code just winds up scanning the local copy of the main database, rather than a simplified and predictable version of it).
So, all you Agile peoples, what is the accepted best practice for doing unit tests that need a particular database configuration to be established and then eliminated after the test? Is it dumping the database to SQL and then reloading it (I hope not, because then I either need to do a lot of paring down to specify a sub-set of the database for each case, or deal with multi-hour testing cycles (it takes > an hour to load the database)).
The particular code being tested cannot use rollback(), btw, as it commits changes to the databases all through the processes (which is pretty much a requirement for database work in Twisted).
Pingbacks are closed.