Leader of Birmingham.pm [pm.org] and a CPAN author [cpan.org]. Co-organised YAPC::Europe in 2006 and the 2009 QA Hackathon, responsible for the YAPC Conference Surveys [yapc-surveys.org] and the QA Hackathon [qa-hackathon.org] websites. Also the current caretaker for the CPAN Testers websites and data stores.
If you really want to find out more, buy me a Guinness
Links:
Memoirs of a Roadie [missbarbell.co.uk]
[pm.org]
CPAN Testers Reports [cpantesters.org]
YAPC Conference Surveys [yapc-surveys.org]
QA Hackathon [qa-hackathon.org]
I want a module that can do two things;
The aim would be to run a test suite, which outputs a file with all the necessary information passing between the application and the database, which can then be munged into a format which can replace the database using Test::MockObject.
The problem I've encountered so far is that, DBI::Profile only records the SQL queries being sent, and it recreates the profile file for each invocation rather than appends data. However, using this as a starting point, there should be no reason that I can't implement something similar. I can't find anything that looks like it can do what I want on CPAN (or Randy Kobes' site), although that may just be me not asking the right question. Note that I'm not after DBD::Mock, as I'm not testing the database calls, just that the munging of the result set is as expected.
So has anyone else thought of something like this? Can DBI::Profile do this? Is there some other module that already does this, or something similar? Is anyone working on a soon to be released distribution that does this? I did wonder whether, like HTTP::Recorder uses HTTP::Proxy, whether I could use DBI::ProxyServer, but that looks to be far too much effort for what I want.
I'm a big advocate of using Test::MockObject instead of trashing someones database. So I thought making life a little easier for anyone who wants to do the same, but can't face writing all the data files for the test suite, would be a good thing.
In other news Mark Stosberg released another version of CGI::Uploader. I have been meaning to finish off the Test::MockObject style testing for him for several months. Having DBI::Recorder would make that so much easier
can plug some of this into DBD::Mock (Score:2)
For your second item above, you can tell DBD::Mock to return results for either the nth SQL statement or for the statement matching the string x. So I don't think it would be too difficult to seed the database handle with the results from a given file -- something like a phrasebook with attached results. There aren't any hooks for creating such a file though.
(Note that I'm no longer maintaining this module -- as of yesterday Stevan Little [cpan.org] has graciously taken it over at my request.)
please - pretty please (Score:2)
My tuit supply has completely dried out (why does the boss expect me to do actual work?), otherwise I would have tried to do something like it myself, but I would be happy to help in any way I can.
Re:please - pretty please (Score:2)