Move the "Already Running" error inside the auto_start block #6

Merged
merged 1 commit into from Mar 23, 2012

Conversation

Projects
None yet
2 participants
@jjn1056
Contributor

jjn1056 commented Feb 28, 2012

This is a tiny patch that moves the "Already Running" error a few lines down so that we only issue it IF we are asked to start a database. That way one can use Test::mysqld to use a database that is already running and created by a previous call to Test::mysqld.

This lets you set auto_start to 0 and skip trying to start the database, without hitting that error message. My use case for this is in DBIx::Class::Migration when a user is using the test database for running upgrades and downgrades but does not want to stop the database first. I also think this change would give you a bit of added flexibility when desiring to run tests against a running database.

Thanks! I've been making great use of your module for Test::DBIx::Class and now DBIx::Class::Migration and ti has really helped me.

@jjn1056

This comment has been minimized.

Show comment Hide comment
@jjn1056

jjn1056 Mar 1, 2012

Contributor

BTW, I looked at Test::postgresql and we don't have a similar problem with that code, it works lovely! Ideally we'd make both test distributions work the same way.

Thanks!

John

Contributor

jjn1056 commented Mar 1, 2012

BTW, I looked at Test::postgresql and we don't have a similar problem with that code, it works lovely! Ideally we'd make both test distributions work the same way.

Thanks!

John

@jjn1056

This comment has been minimized.

Show comment Hide comment
@jjn1056

jjn1056 Mar 5, 2012

Contributor

BTW, let me know if you'd like some docs for the autostart behavior. I was not sure if this ability is something you want as general knowledge or you wanted to keep that part of the API 'under the hood' for now in case you wanted to change it later.

Thanks!

Contributor

jjn1056 commented Mar 5, 2012

BTW, let me know if you'd like some docs for the autostart behavior. I was not sure if this ability is something you want as general knowledge or you wanted to keep that part of the API 'under the hood' for now in case you wanted to change it later.

Thanks!

kazuho added a commit that referenced this pull request Mar 23, 2012

Merge pull request #6 from jjn1056/master
Move the "Already Running" error inside the auto_start block

@kazuho kazuho merged commit 1e889a7 into kazuho:master Mar 23, 2012

@jjn1056

This comment has been minimized.

Show comment Hide comment
@jjn1056

jjn1056 Mar 29, 2012

Contributor

Hey, looks good, and thanks for merging up the code. I installed master to my local lib and checked it out on all my code using it. Let me know if there's anything I can do to help you test this in order to help prepare it for CPAN.

Contributor

jjn1056 commented Mar 29, 2012

Hey, looks good, and thanks for merging up the code. I installed master to my local lib and checked it out on all my code using it. Let me know if there's anything I can do to help you test this in order to help prepare it for CPAN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment