Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Add AR test-connections for JDBC via JRuby

#1685

This is a patch for the AR tests that support running them in JRuby using jdbc connections.

A big part of the reason I'm working on this is to make it easier to test JRuby itself.

For example while developing these tests I found that running them caused JRuby to crash. On Dec 30 2008 Charlie Nutter fixed a JRuby regression that caused these tests to crash. If I can make it easier to run these tests in JRuby we'll find and fix these problems faster.

Here's the JRuby crash I found running the jdbcmysql tests:

The problem was related to hpricot using a deprecated and then deleted JRuby method that was part of it's implementation of fast_xs. AS uses fast_xs if it is present ...

That's just the kind of confusing bug that will be quicker to uncover if it's easier to run these tests in JRuby.

I run the AR mysql jdbc tests like this:

$ jruby -S rake test_jdbcmysql

This patch may well still need some work. I'm going to see if I can get Nick Sieger (recent activerecord-jdbc developer) to review them.

test status with trunk JRuby (r8541) and activerecord-jdbc v0.9

jdbcmysql:      1807 tests, 6004 assertions, 20 failures, 1 errors
jdbcpostgresql: 1812 tests, 1310 assertions, 4 failures, 1675 errors
jdbcsqlite3:    1807 tests, 889 assertions, 15 failures, 1673 errors
jdbch2:         1807 tests, 1809 assertions, 41 failures, 1361 errors
jdbchsqldb:     1807 tests, 4181 assertions, 33 failures, 553 errors
jdbcderby:      1812 tests, 759 assertions, 20 failures, 1765 errors

  • jdbcderby test took over 10m to run

I'm using these gems for the test results above:

$ jruby -S gem list --local activerecord-jdbc

*** LOCAL GEMS ***

activerecord-jdbc-adapter (0.9)
activerecord-jdbcderby-adapter (0.9)
activerecord-jdbch2-adapter (0.9)
activerecord-jdbchsqldb-adapter (0.9)
activerecord-jdbcmysql-adapter (0.9)
activerecord-jdbcpostgresql-adapter (0.9)
activerecord-jdbcsqlite3-adapter (0.9)

Reported by Stephen Bannasch · January 2nd, 2009 @ 05:16 AM

State: committed
Milestone: 2.x
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none

Activity

  1. Nick Sieger
  2. Stephen Bannasch
    Stephen Bannasch

    I rebased to master and updated my patch to include Nick Sieger's changes.

    January 7th, 2009 @ 02:54 AM

  3. enebo
    enebo
    1. It is nice to run unit tests without applying a patch first.

    January 23rd, 2009 @ 04:34 PM

  4. CancelProfileIsBroken
    CancelProfileIsBroken
    1. I've been using this on an experimental version of the Rails CI server to test against JRuby.

    January 23rd, 2009 @ 04:53 PM

  5. Repository
    Repository
    • State changed from new to committed

    (from [b081059913403d626ee1572dec4115aed2048912]) Adding AR tests for JDBC connections

    New connections:

    jdbcmysql jdbcpostgresql jdbcsqlite3 jdbcderby jdbch2 jdbchsqldb jdbcpostgresql

    To test you will need the native database installed (if one is required), activerecord-jdbc-adapter and the specific activerecord-jdbc-adapter for the database you are testing.

    Run the tests like this:

    jruby -S rake test_jdbcmysql

    Signed-off-by: Michael Koziarski michael@koziarski.com [#1685 Add AR test-connections for JDBC via JRuby state:committed] http://github.com/rails/rails/co...

    January 26th, 2009 @ 03:10 AM

  6. Repository
    Repository

    (from [4ef9845aa324679b88e19b8223dd90b774215bc6]) Adding AR tests for JDBC connections

    New connections:

    jdbcmysql jdbcpostgresql jdbcsqlite3 jdbcderby jdbch2 jdbchsqldb jdbcpostgresql

    To test you will need the native database installed (if one is required), activerecord-jdbc-adapter and the specific activerecord-jdbc-adapter for the database you are testing.

    Run the tests like this:

    jruby -S rake test_jdbcmysql

    Signed-off-by: Michael Koziarski michael@koziarski.com [#1685 Add AR test-connections for JDBC via JRuby state:committed] http://github.com/rails/rails/co...

    January 26th, 2009 @ 03:10 AM