in reply to Re: Testing database updates.
in thread Testing database updates.
Thanks for your advice.
The system I decided on was to modify the script I am re-factoring to take the path of an SQLite database on the command line. I then wrote a wrapper .t test script that creates an empty DB with just the schema before each test run. After each test run the DB is dumped to text and compared with the expected output.
My personal take is that I'd much rather start out looking at everything and explicitly choose what I can disregard -- probably through post processing the dumps -- than to prejudge the issues by preselecting what to compare.
I am post processing the dumps as well. I discovered almost immediately that one table contains a timestamp collum that defaults to the current time, so I had to replace that time stamp with a fixed string. I am also post processing the text output to suppress differences in newline chars and trailing whitespace.
I dare say that I will soon have to pass the XML output through a tidy program to remove non syntactic differences in spacing & newlines, or just load both the actual and expected output with XMLin (from XML::Simple), and pass the passed data to is_deeply()
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Testing database updates.
by BrowserUk (Patriarch) on Apr 19, 2012 at 22:26 UTC | |
by chrestomanci (Priest) on Apr 20, 2012 at 08:09 UTC |