Does your code rely heavily on the fact that the DB is mysql? If you're
using DBI and no special backend stuff, you can store an sqlite database for
testing -- it's just one file. Periodically you'd have to upgrade its
snapshot, e.g. when your schema changes, but maybe this is good enough.

mysql does also have optimized dump formats, see mysqldump and the --opt
shorthand option. The fancier your db is the gnarlier this stuff can get, so
be careful.

On Wed, Aug 17, 2011 at 5:36 PM, ik <[email protected]> wrote:

> On Wed, Aug 17, 2011 at 17:24, Shmuel Fomberg <[email protected]> wrote:
>
>> hi all.
>>
>> at work we have a test suit that run against a database. so in the
>> beginning of the test it populate the database with a predefined data.
>> the problem is that this process is way too long, making the test suit
>> take a long time to run.
>> so I'm looking for options to cut this time.
>>
>> is there any ability to freeze a database? so all the changes will be
>> temporary and disappear in the end of the test, leaving the database in
>> a clean state for the next test?
>> maybe some kind of middleware?
>> maybe using transactions? (mysql supports transactions, right?)
>> can transaction hold a large amount of operations / data? (I don't want
>> to limit the test of what it can do to the data...)
>>
>
> There are some frameworks such as Rails that provides the ability to have 3
> (or more)databases. Each one is for specific task, for example, one for
> development, the second for testing and 3rd for production.
>
> You can have such approach at your project, so you just point to a testing
> database rather then a global database that works for everything.
>
>
>
>
>> Shmuel.
>> _______________________________________________
>> Perl mailing list
>> [email protected]
>> http://mail.perl.org.il/mailman/listinfo/perl
>>
>
>
> Ido
>
> _______________________________________________
> Perl mailing list
> [email protected]
> http://mail.perl.org.il/mailman/listinfo/perl
>



-- 
Gaal Yahas <[email protected]>
http://gaal.livejournal.com/
_______________________________________________
Perl mailing list
[email protected]
http://mail.perl.org.il/mailman/listinfo/perl

Reply via email to