Forum: JRuby rails edge now includes activerecord test adaptors for jdbc databases

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
6f608b6766f79343062a2aa3985933dc?d=identicon&s=25 Stephen Bannasch (Guest)
on 2009-01-26 04:55
(Received via mailing list)
The patch on this ticket for rails: Add AR test-connections for JDBC via
JRuby
http://rails.lighthouseapp.com/projects/8994/ticke...

Was just applied to rails edge:
http://github.com/rails/rails/commit/4ef9845aa3246...

This means with edge rails you can now run the full active-record
suite of tests against the following databases connections (without
patching rails):

   jdbcmysql jdbcpostgresql jdbcsqlite3 jdbcderby jdbch2 jdbchsqldb

There's still a bunch of work to do to get most of these databases
and the connectors passing the activerecord test suite.

The jdbcmysql adapter/database is the only one close.

Here are my results from a couple of weeks ago:

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

There's some additional info about how to run the tests in the
Lighthouse ticket link.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Ede2aa10c6462f1d825143879be59e38?d=identicon&s=25 Charles Oliver Nutter (Guest)
on 2009-01-26 07:49
(Received via mailing list)
Stephen Bannasch wrote:
> 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

Heh, I guess we need a little work on the others :) Though with the
number of failures it almost seems like they're misconfigured or
something.

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
13313ac2ec7ba7c43b1b952db034ff3b?d=identicon&s=25 Thomas E Enebo (Guest)
on 2009-01-26 15:54
(Received via mailing list)
Actually, in running sqlite3 the other day I could tell that lack of
column quoting caused almost none of the proper tables to get set up.
I think a few fixes could probably fix a large number of these.

-Tom

On Mon, Jan 26, 2009 at 12:49 AM, Charles Oliver Nutter
<charles.nutter@sun.com> wrote:
>
>
>



--
Blog: http://www.bloglines.com/blog/ThomasEEnebo
Email: enebo@acm.org , tom.enebo@gmail.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Fd4910a54e436dd1f87dc7dcebaee21f?d=identicon&s=25 Thomas Enebo (Guest)
on 2009-01-26 17:04
(Received via mailing list)
Stephen Bannasch wrote:
> This means with edge rails you can now run the full active-record
> Here are my results from a couple of weeks ago:
> There's some additional info about how to run the tests in the
> Lighthouse ticket link.
Thanks for putting this patch together.  Nick had already +1'd it and
when I looked at it I was surprised it hadn't been plus-oned a second
time yet.

Hopefully, we can spend a little bit of time to correct most of these
errors.  Most early errors appear to be the cause of later errors, so
the results are not as dire as they look in the results (at least I
think so).

-Tom

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
22785d4dbf585723bf60458ece0170e1?d=identicon&s=25 Joseph Athman (Guest)
on 2009-01-26 19:48
(Received via mailing list)
Another problem with the sqlite3 adapter is going to be its handling (or
lack there of) in dealing with Dates and Time unless someone has worked
on
this since I put together the original sqlite3 adapter.  I couldn't ever
really figure out how dates are supposed to work with sqlite3 since
according to the documentation it doesn't have built in types for them
http://www.sqlite.org/datatype3.html.  But the native C adadpters seem
to
somehow create them anyways.

Could I also recommend that as we fix these test failures from rails we
try
and port them back in to the actually activerecord-jdbc project's tests?
For example I'm pretty sure the sqlite3 adapter passes these tests, but
obviously it still has major issues.

Joe
13313ac2ec7ba7c43b1b952db034ff3b?d=identicon&s=25 Thomas E Enebo (Guest)
on 2009-01-26 21:03
(Received via mailing list)
On Mon, Jan 26, 2009 at 12:47 PM, Joseph Athman <jjathman@gmail.com>
wrote:
> For example I'm pretty sure the sqlite3 adapter passes these tests, but
> obviously it still has major issues.
>

We did land some fixes for date/time/datetime for sqlite3 recently.

Also we added a few common tests for these fixes for out local
testsuite (interestingly, sharing these helped find bugs in other
adatpers).  So adding more tests is a good idea...

-Tom



--
Blog: http://www.bloglines.com/blog/ThomasEEnebo
Email: enebo@acm.org , tom.enebo@gmail.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
13313ac2ec7ba7c43b1b952db034ff3b?d=identicon&s=25 Thomas E Enebo (Guest)
on 2009-01-26 23:21
(Received via mailing list)
On Mon, Jan 26, 2009 at 2:03 PM, Thomas E Enebo <tom.enebo@gmail.com>
wrote:
>> and port them back in to the actually activerecord-jdbc project's tests?
>> For example I'm pretty sure the sqlite3 adapter passes these tests, but
>> obviously it still has major issues.
>>
>
> We did land some fixes for date/time/datetime for sqlite3 recently.
>
> Also we added a few common tests for these fixes for out local
> testsuite (interestingly, sharing these helped find bugs in other
> adatpers).  So adding more tests is a good idea...

I just a couple of very small changes to sqlite3 adapter and we are:

1812 tests, 5372 assertions, 60 failures, 39 errors (was: 1807 tests,
889 assertions, 15 failures, 1673 errors)

This is looking much better than before.  So, I will try and go
through the other adapters and at least get them far enough past
simple quoting bugs to see where we really stand with each one.

-Tom

--
Blog: http://www.bloglines.com/blog/ThomasEEnebo
Email: enebo@acm.org , tom.enebo@gmail.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
6f608b6766f79343062a2aa3985933dc?d=identicon&s=25 Stephen Bannasch (Guest)
on 2009-01-26 23:42
(Received via mailing list)
>
>1812 tests, 5372 assertions, 60 failures, 39 errors (was: 1807 tests,
>889 assertions, 15 failures, 1673 errors)
>
>This is looking much better than before.  So, I will try and go
>through the other adapters and at least get them far enough past
>simple quoting bugs to see where we really stand with each one.

Thanks Tom!!!

I'm helping where I can and I figured if I could get the tests for
the jdbc adapters into rails edge it would be much easier for all of
us to fix the issues.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
13313ac2ec7ba7c43b1b952db034ff3b?d=identicon&s=25 Thomas E Enebo (Guest)
on 2009-01-27 23:19
(Received via mailing list)
On Mon, Jan 26, 2009 at 4:21 PM, Thomas E Enebo <tom.enebo@gmail.com>
wrote:
>>> Could I also recommend that as we fix these test failures from rails we try
>
> I just a couple of very small changes to sqlite3 adapter and we are:
>
> 1812 tests, 5372 assertions, 60 failures, 39 errors (was: 1807 tests,
> 889 assertions, 15 failures, 1673 errors)
>

Did a few minor changes to Derby adapter:

1817 tests, 5484 assertions, 41 failures, 185 errors (was: 1812 tests,
759 assertions, 20 failures, 1765 errors)

-Tom

--
Blog: http://www.bloglines.com/blog/ThomasEEnebo
Email: enebo@acm.org , tom.enebo@gmail.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Ede2aa10c6462f1d825143879be59e38?d=identicon&s=25 Charles Oliver Nutter (Guest)
on 2009-01-28 09:05
(Received via mailing list)
Joseph Athman wrote:
> That's just great getting the sqlite3 adapter working so well, I think
> supporting the default rails db type will be nice for anyone looking to
> try out JRuby.

BTW, if anyone knows where to patch, it would be *supergreat* to get the
"rails" command to accept our "jdbc" adapter names, like

rails -d jdbcmysql

If there's a set of names it recognizes, we ought to be able to just
submit a patch for our JDBC versions, so they generate the right
database.yml under JRuby too.

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
22785d4dbf585723bf60458ece0170e1?d=identicon&s=25 Joseph Athman (Guest)
on 2009-01-28 10:10
(Received via mailing list)
I see in the code where this is going on, but I'm wondering what the
best
solution is.  I see 3 choices:

1) We just follow the same model in the current code and add the jdbc
adapters as valid choices and add corresponding database.yml templates
for
each of our adapters  (unfortunately quite a bit of redundancy there
with
nearly identical yml files)

2) In each of the template database.yml files, do a simple check of the
environment being used to create the file, if we are using jruby, simply
append jdbc to the front of the adapter name.  So if you generate your
rails
app using JRuby you just send normal options to the rails command, but
when
it generates your app it will put "jdbcmysql" as the adapter instead of
just
"mysql", as an example.

3) Change the rails app generators to make the database.yml files jdbc
and
native driver safe out of the box.  So intead of:
development:
  adapter: mysql
  encoding: utf8
  database: myapp_development
  pool: 5
  username: root
  password:
  host: localhost

Actually generate the database.yml file as:

development:
  adapter: <%= RUBY_PLATFORM =~ /java/ ? 'jdbc' : '' %>mysql
  encoding: utf8
  database: myapp_development
  pool: 5
  username: root
  password:
  host: localhost

right out of the box.  Anyone have any thoughts?  For an example of one
of
the yml files see this:
http://github.com/rails/rails/blob/9714a9b0019e6ca...

Joe


On Tue, Jan 27, 2009 at 9:02 AM, Charles Oliver Nutter <
Ede2aa10c6462f1d825143879be59e38?d=identicon&s=25 Charles Oliver Nutter (Guest)
on 2009-01-28 10:18
(Received via mailing list)
Well 1 probably would mean the least amount of change, but you're right
about it being a lot of duplication. But 2 and 3 seem unlikely to happen
since they would mean adding JRuby-specific stuff to every template.
Then what happens with the next impl and the next?

I'm leaning toward just doing 1 for now and having a jruby dir with all
our supported adapter names and templates. They'll probably be
duplicates in several cases, but they'll be totally new in others (h2,
derby for example).

- Charlie

Joseph Athman wrote:
> append jdbc to the front of the adapter name.  So if you generate your
>   pool: 5
>   pool: 5
>
>     BTW, if anyone knows where to patch, it would be *supergreat* to get
>
>     ---------------------------------------------------------------------
>     To unsubscribe from this list, please visit:
>
>       http://xircles.codehaus.org/manage_email
>
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
22785d4dbf585723bf60458ece0170e1?d=identicon&s=25 Joseph Athman (Guest)
on 2009-01-28 10:32
(Received via mailing list)
I'm sure you are right that path #1 is the least resistance.  One thing
I've
never found out is why do we have to put "jdbcmysql" anyways?  Isn't
there
some way in the JDBC adapters to get just "mysql" to load the correct
jdbc
adapter?  It seems like that is the "right" answer.  I would think the
ultimate goal would be for a developer to write their application one
way no
matter what the Ruby implementation used is.  I'm sure there is a good
reason I just can't remember what it is now.
To pursue #1 we just start by making a lighthouse ticket right?

Joe

On Tue, Jan 27, 2009 at 11:04 PM, Charles Oliver Nutter <
13313ac2ec7ba7c43b1b952db034ff3b?d=identicon&s=25 Thomas E Enebo (Guest)
on 2009-01-28 16:53
(Received via mailing list)
On Tue, Jan 27, 2009 at 11:17 PM, Joseph Athman <jjathman@gmail.com>
wrote:
> I'm sure you are right that path #1 is the least resistance.  One thing I've
> never found out is why do we have to put "jdbcmysql" anyways?  Isn't there
> some way in the JDBC adapters to get just "mysql" to load the correct jdbc
> adapter?  It seems like that is the "right" answer.  I would think the
> ultimate goal would be for a developer to write their application one way no
> matter what the Ruby implementation used is.  I'm sure there is a good
> reason I just can't remember what it is now.
> To pursue #1 we just start by making a lighthouse ticket right?

Yes, but I think they like patches attached to those tickets as well.
  So if you don't have the patch ready perhaps specify you are working
on the enhancement so they don't close it out of hand.

Thanks for working on this... :)

-Tom

--
Blog: http://www.bloglines.com/blog/ThomasEEnebo
Email: enebo@acm.org , tom.enebo@gmail.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
This topic is locked and can not be replied to.