You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by "Rhett Sutphin (JIRA)" <ji...@apache.org> on 2009/02/17 22:16:59 UTC

[jira] Created: (BUILDR-256) Automatically installing gems aborts rspec test runner

Automatically installing gems aborts rspec test runner
------------------------------------------------------

                 Key: BUILDR-256
                 URL: https://issues.apache.org/jira/browse/BUILDR-256
             Project: Buildr
          Issue Type: Bug
    Affects Versions: 1.3.3
         Environment: RubyGems 1.2.0
            Reporter: Rhett Sutphin
            Priority: Minor


The automatic jruby gem installer code (the template for which is created by the jruby_gem method in TestFramework::JRubyBased) uses Gem::GemRunner to automatically install gems.  GemRunner (at least in RubyGems 1.2.0) always throws Gem::SystemExitException when it completes.  This aborts the runner and returns control to buildr.  Buildr then fails with an exception because result.yaml doesn't exist.

Workaround: each run will successfully install one of the gems, so you can run the test several times to install all the gems.  Alternatively, you can manually install the necessary gems using jruby -S gem install.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (BUILDR-256) Automatically installing gems aborts rspec test runner

Posted by "Alex Boisvert (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BUILDR-256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex Boisvert updated BUILDR-256:
---------------------------------

    Fix Version/s:     (was: 1.3.4)
                   1.4

> Automatically installing gems aborts rspec test runner
> ------------------------------------------------------
>
>                 Key: BUILDR-256
>                 URL: https://issues.apache.org/jira/browse/BUILDR-256
>             Project: Buildr
>          Issue Type: Bug
>    Affects Versions: 1.3.3
>         Environment: RubyGems 1.2.0
>            Reporter: Rhett Sutphin
>            Priority: Minor
>             Fix For: 1.4
>
>
> The automatic jruby gem installer code (the template for which is created by the jruby_gem method in TestFramework::JRubyBased) uses Gem::GemRunner to automatically install gems.  GemRunner (at least in RubyGems 1.2.0) always throws Gem::SystemExitException when it completes.  This aborts the runner and returns control to buildr.  Buildr then fails with an exception because result.yaml doesn't exist.
> Workaround: each run will successfully install one of the gems, so you can run the test several times to install all the gems.  Alternatively, you can manually install the necessary gems using jruby -S gem install.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (BUILDR-256) Automatically installing gems aborts rspec test runner

Posted by "Rhett Sutphin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BUILDR-256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12778673#action_12778673 ] 

Rhett Sutphin commented on BUILDR-256:
--------------------------------------

The same monkey patch will work with buildr 1.3.5 and jruby 1.3.1 (rubygems 1.3.3) with the following changes:

- Replace "Kernel.gem name, version" with "Kernel.send :gem, name, version"
- Remove the Gem.manage_gems line

> Automatically installing gems aborts rspec test runner
> ------------------------------------------------------
>
>                 Key: BUILDR-256
>                 URL: https://issues.apache.org/jira/browse/BUILDR-256
>             Project: Buildr
>          Issue Type: Bug
>    Affects Versions: 1.3.3
>         Environment: RubyGems 1.2.0
>            Reporter: Rhett Sutphin
>            Priority: Minor
>             Fix For: 1.4
>
>
> The automatic jruby gem installer code (the template for which is created by the jruby_gem method in TestFramework::JRubyBased) uses Gem::GemRunner to automatically install gems.  GemRunner (at least in RubyGems 1.2.0) always throws Gem::SystemExitException when it completes.  This aborts the runner and returns control to buildr.  Buildr then fails with an exception because result.yaml doesn't exist.
> Workaround: each run will successfully install one of the gems, so you can run the test several times to install all the gems.  Alternatively, you can manually install the necessary gems using jruby -S gem install.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (BUILDR-256) Automatically installing gems aborts rspec test runner

Posted by "Antoine Toulme (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BUILDR-256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antoine Toulme resolved BUILDR-256.
-----------------------------------

      Assignee: Antoine Toulme
    Resolution: Fixed

18:41:32~/w/buildr>svn ci CHANGELOG lib/buildr/java -m "fix for BUILDR-256 and BUILDR-342"
Sending        CHANGELOG
Sending        lib/buildr/java/bdd.rb
Transmitting file data ..
Committed revision 961552.

Thanks Rhett!

> Automatically installing gems aborts rspec test runner
> ------------------------------------------------------
>
>                 Key: BUILDR-256
>                 URL: https://issues.apache.org/jira/browse/BUILDR-256
>             Project: Buildr
>          Issue Type: Bug
>    Affects Versions: 1.3.3
>         Environment: RubyGems 1.2.0
>            Reporter: Rhett Sutphin
>            Assignee: Antoine Toulme
>            Priority: Minor
>             Fix For: 1.4.2
>
>
> The automatic jruby gem installer code (the template for which is created by the jruby_gem method in TestFramework::JRubyBased) uses Gem::GemRunner to automatically install gems.  GemRunner (at least in RubyGems 1.2.0) always throws Gem::SystemExitException when it completes.  This aborts the runner and returns control to buildr.  Buildr then fails with an exception because result.yaml doesn't exist.
> Workaround: each run will successfully install one of the gems, so you can run the test several times to install all the gems.  Alternatively, you can manually install the necessary gems using jruby -S gem install.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (BUILDR-256) Automatically installing gems aborts rspec test runner

Posted by "Antoine Toulme (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BUILDR-256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antoine Toulme updated BUILDR-256:
----------------------------------

    Fix Version/s: 1.4.2
                       (was: Wish List)

> Automatically installing gems aborts rspec test runner
> ------------------------------------------------------
>
>                 Key: BUILDR-256
>                 URL: https://issues.apache.org/jira/browse/BUILDR-256
>             Project: Buildr
>          Issue Type: Bug
>    Affects Versions: 1.3.3
>         Environment: RubyGems 1.2.0
>            Reporter: Rhett Sutphin
>            Priority: Minor
>             Fix For: 1.4.2
>
>
> The automatic jruby gem installer code (the template for which is created by the jruby_gem method in TestFramework::JRubyBased) uses Gem::GemRunner to automatically install gems.  GemRunner (at least in RubyGems 1.2.0) always throws Gem::SystemExitException when it completes.  This aborts the runner and returns control to buildr.  Buildr then fails with an exception because result.yaml doesn't exist.
> Workaround: each run will successfully install one of the gems, so you can run the test several times to install all the gems.  Alternatively, you can manually install the necessary gems using jruby -S gem install.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (BUILDR-256) Automatically installing gems aborts rspec test runner

Posted by "Antoine Toulme (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BUILDR-256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antoine Toulme updated BUILDR-256:
----------------------------------

    Fix Version/s:     (was: 1.4)
                   Wish List

Rhett, I think this will get fixed eventually - you should probably open a bug against rubygems for them to fix that behavior ?
I am deferring the issue to wishlist.

> Automatically installing gems aborts rspec test runner
> ------------------------------------------------------
>
>                 Key: BUILDR-256
>                 URL: https://issues.apache.org/jira/browse/BUILDR-256
>             Project: Buildr
>          Issue Type: Bug
>    Affects Versions: 1.3.3
>         Environment: RubyGems 1.2.0
>            Reporter: Rhett Sutphin
>            Priority: Minor
>             Fix For: Wish List
>
>
> The automatic jruby gem installer code (the template for which is created by the jruby_gem method in TestFramework::JRubyBased) uses Gem::GemRunner to automatically install gems.  GemRunner (at least in RubyGems 1.2.0) always throws Gem::SystemExitException when it completes.  This aborts the runner and returns control to buildr.  Buildr then fails with an exception because result.yaml doesn't exist.
> Workaround: each run will successfully install one of the gems, so you can run the test several times to install all the gems.  Alternatively, you can manually install the necessary gems using jruby -S gem install.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (BUILDR-256) Automatically installing gems aborts rspec test runner

Posted by "Rhett Sutphin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BUILDR-256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674426#action_12674426 ] 

Rhett Sutphin commented on BUILDR-256:
--------------------------------------

The following monkey-patch fixes this problem.  It also autoinstalls the gems without ri or rdoc so that they install much faster and it provides information about why buildr decided the gem needed to be installed with --trace.

I'll try to provide this as a more formal patch when I have a chance.

require 'buildr/java/bdd'

module Buildr::TestFramework::JRubyBased
  protected

  def jruby_gem
    %{
     require 'jruby'
     def JRuby.gem(name, version = '>0', *args)
        require 'rbconfig'
        jruby_home = Config::CONFIG['prefix']
        expected_version = '#{TestFramework::JRubyBased.version}'
        unless JRUBY_VERSION >= expected_version
          fail "Expected JRuby version \#{expected_version} installed at \#{jruby_home} but got \#{JRUBY_VERSION}"
        end
        require 'rubygems'
        begin
          Kernel.gem name, version
        rescue LoadError, Gem::LoadError => e
          #{'puts "Gem #{name} (#{version}) not found.  Installing.  (Message: #{e.message}.)"' if Buildr.application.options.trace}
          require 'rubygems/gem_runner'
          Gem.manage_gems
          args = ['install', name, '--version', version, '--no-ri', '--no-rdoc'] + args
          begin
            Gem::GemRunner.new.run(args)
          rescue Gem::SystemExitException=>e
            if e.exit_code == 0
              #{'puts "Successfully installed.  #{e.message}"' if Buildr.application.options.trace}
            else
              puts "Install of \#{name} (\#{version}) failed. \#{e.message}"
              raise e
            end
          end
          Kernel.gem name, version
        end
     end
    }
  end
end


> Automatically installing gems aborts rspec test runner
> ------------------------------------------------------
>
>                 Key: BUILDR-256
>                 URL: https://issues.apache.org/jira/browse/BUILDR-256
>             Project: Buildr
>          Issue Type: Bug
>    Affects Versions: 1.3.3
>         Environment: RubyGems 1.2.0
>            Reporter: Rhett Sutphin
>            Priority: Minor
>
> The automatic jruby gem installer code (the template for which is created by the jruby_gem method in TestFramework::JRubyBased) uses Gem::GemRunner to automatically install gems.  GemRunner (at least in RubyGems 1.2.0) always throws Gem::SystemExitException when it completes.  This aborts the runner and returns control to buildr.  Buildr then fails with an exception because result.yaml doesn't exist.
> Workaround: each run will successfully install one of the gems, so you can run the test several times to install all the gems.  Alternatively, you can manually install the necessary gems using jruby -S gem install.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (BUILDR-256) Automatically installing gems aborts rspec test runner

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BUILDR-256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12886211#action_12886211 ] 

Hudson commented on BUILDR-256:
-------------------------------

Integrated in Buildr-ci-build #53 (See [http://hudson.zones.apache.org/hudson/job/Buildr-ci-build/53/])
    fix for BUILDR-256 and BUILDR-342


> Automatically installing gems aborts rspec test runner
> ------------------------------------------------------
>
>                 Key: BUILDR-256
>                 URL: https://issues.apache.org/jira/browse/BUILDR-256
>             Project: Buildr
>          Issue Type: Bug
>    Affects Versions: 1.3.3
>         Environment: RubyGems 1.2.0
>            Reporter: Rhett Sutphin
>            Assignee: Antoine Toulme
>            Priority: Minor
>             Fix For: 1.4.2
>
>
> The automatic jruby gem installer code (the template for which is created by the jruby_gem method in TestFramework::JRubyBased) uses Gem::GemRunner to automatically install gems.  GemRunner (at least in RubyGems 1.2.0) always throws Gem::SystemExitException when it completes.  This aborts the runner and returns control to buildr.  Buildr then fails with an exception because result.yaml doesn't exist.
> Workaround: each run will successfully install one of the gems, so you can run the test several times to install all the gems.  Alternatively, you can manually install the necessary gems using jruby -S gem install.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.