[R-sig-DB] RMySQL release candidate 0-7.0

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Sun Nov 16 17:02:41 CET 2008


On 16 November 2008 at 11:26, Prof Brian Ripley wrote:
| 5) Uwe Ligges and I and Dirk Edelbuettel (as maintainer) have worked out a 

[ Almost:  s/Edel/Eddel/ ]

| way to have RPostgreSQL built on the main Windows package builder.  We 
| could try to do the same here, but none of us are happy with distributing 
| a binary build that has no tests at all (as RMySQL runs no actual 
| examples).  So can we please have a test suite?  You will need to allow 
| the DBMS account, password and database name to be set via environment 
| variables, as for RPostgreSQL.

That was a leftover of me trying to get the Summer of Code whom I mentored
for RPostgreSQL student to write 'test-driven' code. Which didn't work so
well as he wrote code but few tests, but I ended up writing some tests for
him.  Kurt then had an issue with these tests running _un_conditionally and
hence upsettting CRAN tests (that have no backend) so between Uwe, Brian and
myself we came up with code where each file in tests/ starts as

-----------------------------------------------------------------------------
if ((Sys.getenv("POSTGRES_USER") != "") &
    (Sys.getenv("POSTGRES_HOST") != "") &
    (Sys.getenv("POSTGRES_DATABASE") != "")) {

    ## try to load our module and abort if this fails
    stopifnot(require(RPostgreSQL))

    ## load the PostgresSQL driver
    drv <- dbDriver("PostgreSQL")
    ## can't print result as it contains process id which changes  print(summary(drv))

    ## connect to the default db
    con <- dbConnect(drv,
                     user=Sys.getenv("POSTGRES_USER"),
                     password=Sys.getenv("POSTGRES_PASSWD"),
                     host=Sys.getenv("POSTGRES_HOST"),
                     dbname=Sys.getenv("POSTGRES_DATABASE"))


    # tests follow below ...
-----------------------------------------------------------------------------

which allowed Brian and Uwe to test on their end as well.  The actual tests
are creating (and the removing) tables and ensuring things come out as
identical() and/or same class() as the input.  I still need to add one for
transaction management.
 
| 6) I've put a version of the revised sources I used to test on Windows 
| (and with updated documentation and unused files removed) at
| 
| http://www.stats.ox.ac.uk/pub/R/RMySQL_0.7-1.tar.gz
| 
| I tested MySQL 5.0.67 on Windows and 5.0.45 on Linux, and I think these 
| days we should only support MySQL 5.

As Debian maintainer for r-cran-rmysql I'd also be happy to test there.

Dirk
 
-- 
Three out of two people have difficulties with fractions.




More information about the R-sig-DB mailing list