SilasTheMonk has asked for the wisdom of the Perl Monks concerning the following question:
I having some issues writing test scripts for CGI-Application-Plugin-PageLookup. The Makefile.PL lists DBI as a dependency but I do not state a dependency on any particular driver because of course it should not depend on any particular driver (or at least I would hope). In production I use DBD::mysql but my test scripts use DBD::SQLite. The test scripts are now generally failing because many test machines do not have DBD::SQLite installed. In fact I have failed to install DBD::SQLite on my production machine. So now I am looking for an alternative. mysql will not do because many machines (including my production machine) do not permit creating databases from scripts (or even via phpmyadmin). From the documentation I cannot see how one would use DBD::Sponge which is a shame since that ships with DBI itself. DBD::CSV looks promising but happens to be not installed on my production machine. It happens that I wrote a similar query to this sometime back writing DBI applications offline so I am reviewing that.
First question: Why would DBI be installed on a test machine but not a sensible driver? I cannot see a sensible answer to that even for test machines. The failing machines seem to support the following drivers: DBM, ExampleP, File, Gofer, Mock, Proxy, Sponge.
What are my options? I can think of the following:
I have the strong feeling I am going to regret posting this because somewhere up there I have answered my own question. At the very least it would be nice to know if other people have found similar issues and how they solved them.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to write test scripts depending on DBI
by ikegami (Patriarch) on Oct 05, 2009 at 19:49 UTC | |
by SilasTheMonk (Chaplain) on Oct 05, 2009 at 20:00 UTC | |
by ikegami (Patriarch) on Oct 05, 2009 at 20:24 UTC | |
by SilasTheMonk (Chaplain) on Oct 05, 2009 at 20:36 UTC | |
by ikegami (Patriarch) on Oct 05, 2009 at 21:49 UTC | |
| |
|
Re: How to write test scripts depending on DBI
by JavaFan (Canon) on Oct 05, 2009 at 19:27 UTC | |
by SilasTheMonk (Chaplain) on Oct 05, 2009 at 19:50 UTC |