in reply to Building a test environment

This sounds like a good candidate for some sort of unit testing. If I grok your post (and I'm not sure I do :), it sounds like the problems you're running in to come from trying to test the application as a whole. You might try breaking it down into units, and testing each of them individually.

As a trivial example, take the login function. Your unit test could set up a fake DB, run the function that checks credentials, and check the result. The user creation test could work in a similar way, running the code with some supplied input, and then checking the resulting DB entry. Right now, it sounds like you're trying to create the user, log in, and use the application all in one test (correct me if I'm wrong).

Most unit testing code will allow you to do things like this, starting with a clean environment (FS, DB..), inserting some test data (files, db records), running the code (a few runs of some function with different input), and cleaning up.

I've never done unit testing with /perl/, so I don't know what's out there, but a quick google suggests that there are more than a few frameworks for perl.

Hope that helps.

Replies are listed 'Best First'.
Re^2: Building a test environment
by talexb (Chancellor) on Jun 05, 2007 at 19:20 UTC

    Thanks -- I'm not sure unit testing is possible, but the idea of using a mock database is starting to look like a really good idea. This is a CGI::Application doodad, something I should have mentioned earlier .. and Andy Lester suggested Test::WWW::Mechanize a while back .. I'll have to look at that as well.

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds