Patch #5404
closedFix Redmine tests for JRuby 1.4.x and 1.5.0
Added by Gregor Schmidt over 14 years ago. Updated over 12 years ago.
0%
Description
Files
5404_fix_redmine_on_jruby_stable.diff (8.39 KB) 5404_fix_redmine_on_jruby_stable.diff | Gregor Schmidt, 2010-04-29 20:21 | ||
5404_fix_redmine_on_jruby_trunk.diff (8.54 KB) 5404_fix_redmine_on_jruby_trunk.diff | Gregor Schmidt, 2010-04-29 20:21 | ||
git_adapter.rb.diff (397 Bytes) git_adapter.rb.diff | Fix Git adapter on JRuby and Windows | Babar O'Cap, 2010-06-23 10:35 |
Related issues
Updated by Gregor Schmidt over 14 years ago
Updated by Eric Davis over 14 years ago
Anyone with experience with jruby want to test these? It would be nice to fully support jruby in Redmine 1.0.
Updated by Jean-Philippe Lang over 14 years ago
I have made a few tests with JRuby1.4.0 / Win32 with Mysql and SQLite3. I'm still getting a bunch of failures with Mysql. It's much better with Sqlite3 (after fixing a few errors in r3700 and r3701). What's your testing platform? Also, it looks like Bazaar tests all failed.
Your patch includes a few patches to JDBC postgres and sqlite3 adapters. Where do this patches come from? I'd really like that the adapters get fixed rather than including these patches in the Redmine code.
>java -version java version "1.6.0_17" Java(TM) SE Runtime Environment (build 1.6.0_17-b04) Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing) >jruby -v jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (Java HotSpot(TM) Client VM 1.6.0_17) [x86-java]
Updated by Gregor Schmidt over 14 years ago
Thank you for having a look at the patch.
I was testing on Mac OS X using the JVM shipped with 10.5.
$ ruby -v jruby 1.4.1 (ruby 1.8.7 patchlevel 174) (2010-04-26 ea6db6a) (Java HotSpot(TM) Server VM 1.5.0_22) [i386-java] $ ruby -v jruby 1.5.0.RC2 (ruby 1.8.7 patchlevel 249) (2010-04-28 7c245f3) (Java HotSpot(TM) Server VM 1.5.0_22) [i386-java] $ java -version java version "1.5.0_22" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03-333-9M3125)
I forgot to mention, that the SQLite test do not work on my machine either. It seems, that activerecord-jdcbsqlite3-adapter and jdbc-sqlite3 are way behind the sqlite3-ruby gem. Both show very different behaviour on my machine. MySQL (5.1.45) and PostgreSQL (8.3.4) on the other hand work without problems.
Concerning the patches to activerecord-jdbc*-adapter¶
The patch to the Postgres adapter is filed as Bug on AR-JDBC-104 and I wrote a mail to the jruby list. Unfortunately, I did not get any feedback.
I'm not sure about the Patches to the SQLite3 adapter. I wrote another mail to the JRuby Mailing list, concerning my problems, I had with SQLite and also added a simple test case. Unfortunately I did not get any feedback here, either.
Therefore, I've added the patches into a single file, such that we are able to keep an eye on them. I totally get your argument about getting the adapters fixed instead of fixing them in redmine, but I wanted to get the test running and a working Redmine. I will keep bullying the AR-JDBC guys to get their libraries fixed.
Repository Adapters¶
Sorry, I was a bit hastily. I've only tested file system, mercurial, subversion and git. I simply forgot the others. I could have a look at bazaar, cvs and darcs, if you like.
Updated by Jean-Philippe Lang over 14 years ago
The patch to Engines to make use of Rails.public_path does not seem to have any effect when deploying a WAR.
When Engines gets loaded, Rails.public_path points to WEB-INF/public and thus assets are mirrored to WEB-INF/public. After the application started Rails.public_path points to the root of the webapp but it's too late... I really don't know how to fix it.
Updated by Gregor Schmidt over 14 years ago
Jean-Philippe Lang wrote:
The patch to Engines to make use of Rails.public_path does not seem to have any effect when deploying a WAR.
When Engines gets loaded, Rails.public_path points to WEB-INF/public and thus assets are mirrored to WEB-INF/public. After the application started Rails.public_path points to the root of the webapp but it's too late... I really don't know how to fix it.
You are totally right. When I fixed the theme loading mechanism, I grepped for other occurances of RAILS_ROOT + '/public' and replaced them with Rails.public_path with further testing. But after the change, its a bug in JRuby-Rack. Beforehand it was one in Redmine. Therefore the change has a certain value, somehow.
I will try to debug the issue in the context of JRuby-Rack and give feedback, once I have made some progress on that.
Updated by Jean-Philippe Lang over 14 years ago
The only way I found to fix it is the following patch:
Index: config/environment.rb =================================================================== --- config/environment.rb (revision 3701) +++ config/environment.rb (working copy) @@ -13,6 +13,11 @@ # Load Engine plugin if available begin require File.join(File.dirname(__FILE__), '../vendor/plugins/engines/boot') + module Engines + def self.public_directory + File.join(Rails.public_path, 'plugin_assets') + end + end rescue LoadError # Not available end
It works because Rails.public_path is properly set when assets get actually mirrored.
Updated by Gregor Schmidt over 14 years ago
Your fix works for me, but I still think, that this would be a bug in JRuby-Rack, which is responsible for setting the correct public_path.
Currently it's no problem for me, that it does not work correctly, since the plugin assets are already copied when 'environment' is loaded during my warbling.
Updated by Jean-Philippe Lang over 14 years ago
Gregor Schmidt wrote:
Currently it's no problem for me, that it does not work correctly, since the plugin assets are already copied when 'environment' is loaded during my warbling.
I wasn't aware of that. Then I think we can live without this patch.
Updated by Jean-Philippe Lang over 14 years ago
Mercurial and Bazaar adapters are now fixed for JRuby.
r3724 passes all tests with JRuby 1.5.0 RC2 and MySQL for me. But it looks like something still goes wrong at finn.de:
http://ci.finn.de/builds/jruby_redmine-trunk_mysql/3724
Updated by Jean-Philippe Lang over 14 years ago
- PostgreSQL: all tests pass
- SQLite3: the patches almost fix it, but there's still a failure (leaving the due date field empty when creating an issue leads to "Due date must be greater than start date")
Updated by Gregor Schmidt over 14 years ago
Concerning the failures on ci.finn.de. rake db:schema:dump
produces a faulty db/schema.rb
. All tests pass, when using config.active_record.schema_format = :sql
. I will try to build a simple failing test case for AR-JDBC, as I think it is their fault.
Concerning the jruby_compat initializer. As long as they are not fixed in AR-JDBC itself, are you willing to provide these patches in Redmine itself or should be publish them via plugin for everybody interested?
Updated by Gregor Schmidt over 14 years ago
Furthermore I would like to thank you for your fast feedback and integration of the patches.
Updated by Gregor Schmidt over 14 years ago
The db:schema:dump
bug is now known as ACTIVERECORD_JDBC-112. Let's that this will be fixed soon.
Updated by Babar O'Cap over 14 years ago
- File git_adapter.rb.diff git_adapter.rb.diff added
I've a bug with JRuby 1.5.1 in Git repositories on Windows.
Redmine::Scm::Adapters::GitAdapter#last_rev source:trunk/lib/redmine/scm/adapters/git_adapter.rb#L87 doesn't work properly.
Here a patch to fix this issue.
NB: I didn't test on an other platform.
Updated by Toshi MARUYAMA almost 14 years ago
Babar O'Cap wrote:
I've a bug with JRuby 1.5.1 in Git repositories on Windows.
Redmine::Scm::Adapters::GitAdapter#last_rev source:trunk/lib/redmine/scm/adapters/git_adapter.rb#L87 doesn't work properly.
Here a patch to fix this issue.
It seems io.gets() problem of git adapter.
I posted git-io-gets.diff to fix it at note-11 of #5096.
Updated by Jean-Philippe Lang over 12 years ago
- Status changed from New to Closed
Closing it, the test suite is running fine with JRuby 1.6.7 now.