diment at gmail
Feb 29, 2012, 4:36 AM
Post #3 of 3
On 29/02/2012, at 11:23 PM, Drew Taylor wrote:
> Thank you for putting this out! At work I'm dealing with a custom ORM
> for legacy code and limited use of DBIC where possible in newer code,
> which system of course has very, very few tests. I'm trying to improve
> the meagre test suite, but my efforts so far for manually creating
> fixture data are too brittle for a long term solution.
> And of course new $job uses Mysql, where old $job used Postgresql.
> I've looked briefly at things like MySQL::Sandbox  and
> Test::DataLoader::MySQL  but I'm not quite sure what the best
> practice is with Mysql. Any tips or future articles on this topic
> would certainly be very useful to me. Being able to quickly bring up a
> database, which can be wiped and populated at will, for a specific .t
> file would be all kinds of useful.
I guess to follow the technique Eden and I worked out, you'll be looking at taking the sql injection trait we wrote, and ripping the guts out to deal with mysqld instead of postgres.
For mysql everything should be pretty much the same except for the commands to run mysqld in place of $psql_cmd in our Test::DBIx::Class::SchemaManager::Trait::DeploySQL.
>  https://metacpan.org/module/MySQL::Sandbox
>  https://metacpan.org/module/Test::DataLoader::MySQL
> On Wed, Feb 29, 2012 at 8:25 PM, Kieren Diment <diment [at] gmail> wrote:
>> You may recall that the Catalyst Advent calendar was retired at the end of 2011 in favour of a series of monthly articles. We missed January, for various reasons, one of which was that we needed to decide what infrastructure we were going to use to publish this stuff.
>> Eventually we realised that CPAN is already a perfectly good publishing mechanism. So here it is - the first of the Catalyst monthly articles:
>> https://metacpan.org/module/ZARQUON/Catalyst-Manual-Monthly-0.01/lib/Catalyst/Manual/Monthly/2012/February/TestDBICWithBellsOn.pod (or http://xrl.us/bmwfzz if your email client doesn't like long links).
>> In due course (and with suitable volunteer labour *ahem*) we expect to have an RSS feed and aggregator to bring all of the links together in a slightly more appropriate way for docs than search.cpan.org or metacpan.org.
>> And if you want to write an article for us, get on IRC and suggest away. We're not expecting anything more substantial than the old advent calendar articles.
>> Catalyst-dev mailing list
>> Catalyst-dev [at] lists
> Catalyst-dev mailing list
> Catalyst-dev [at] lists
Catalyst-dev mailing list
Catalyst-dev [at] lists