I have some modules that make use of a database. I'm biased towards mysql, but at least for testing purposes, using sqlite is absolutely wonderful.

I'm a sucker for tests. I think it actually speeds up development, a lot.

I have some situations where mysql and sqlite behaviour is different. Where one SQL call is not going to work the same way for both database 'formats' (is that what you call them?)

I want to offer to test both mysql and sqlite.

I noticed for example with DBD::mysql, you need to have a local mysqld server daemon running to install without force.

I also noticed that the tests do not ask what database name, user and password to use.

Is it going behind my back and creating these? And then deleting them? Maybe it's not making any inserts/creates? doubt it..

In my tests that require mysql. Should I prompt the user for a testing database name, user and password? Or should I create those and then delete them? I would probably rather not, it feels intrusive on my code's part.

Is there an established convention for a mysql testing database, like 'guest_database', 'guest_user', 'guest_password' ?

What would be the right thing to do?


In reply to Established convention for testing using mysql? by leocharre

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.