List:MySQL and Perl« Previous MessageNext Message »
From:Jochen Wiedmann Date:January 30 2003 9:19am
Subject:Re: Adding more options to Makefile.PL for testing
View as plain text  
Zitiere Jay Lawrence <jlawrenc@stripped>:

> I am running across some limitations in the current tests. In my case I
> have relocated my socket and options files so that I can have more than
> one independent instance of MySQL running.

> Therefore I started to upgrade the Makefile.PL to allow for
> 	--testsocket
> 	--testdefaults
> 	--testgroup

Please, don't. I do not know, whether this is currently
present. If not, add the option

        --testdsn

All of the above can be specified as part of the DSN.


> I am running against the need to modify more of the tests to allow 
> tests like, say, akmisc.t to run properly. (It assumes just a simple 
> host to connect with).

This is indeed the single reason why "testhost" and "testport" are
used: Downwards compatibility to the "Mysql" module.


I would suggest the following:

  - Add a new option --testdsn with the following rules: If
    --testdsn is specified, then --testhost, --testport and
    --testdb are ignored. Even more, if they are specified,
    then a warning should be issued, that these options are
    deprecated and being removed a future version.

  - Update the test scripts for DBD::mysql to use this option.

  - Change the Mysql module to allow specifying a DSN rather
    than host, port and database. For example, I would suggest
    to verify whether the "host" string starts with "DBI:mysql"
    (not with DBI:mysql:, so that a driver like "DBI:mysqlEmbed"
    works in the future!). If so, take the "host" value as a
    DSN and the following values as user and password, as in

        Mysql->connect("DBI:mysql:mydb", "joe", "joespassword");

    (Do not forget to update the "Mysql" docs appropriately!)

    Update the Mysql tests to make use of that feature.


If you do all of the above, I'd be *quite* happy to accept a
patch.


Regards,

Jochen
Thread
Adding more options to Makefile.PL for testingJay Lawrence29 Jan
  • Re: Adding more options to Makefile.PL for testingJochen Wiedmann30 Jan