≡

wincent.dev

  • Products
  • Blog
  • Wiki
  • Issues
You are viewing an historical archive of past issues. Please report new issues to the appropriate project issue tracker on GitHub.
Home » Issues » Bug #1666

Bug #1666: JRuby infrastructure needed on production server in order to run full acceptance test suite

Kind bug
Product wincent.dev
When Created 2010-08-30T14:58:33Z, updated 2010-09-12T08:06:20Z
Status closed
Reporter Greg Hurrell
Tags no tags

Description

As noted in ticket #1655, until this is installed and set up, won't be able to run the full suite on the production server.

Comments

  1. Greg Hurrell 2010-09-11T23:56:18Z

    Starting to test this out now:

    # yum install java-1.7.0-icedtea
    # java -version

    This is enough to get a downloaded JRuby to run; I just need to decide where I am going to install it and how to set the PATH appropriately so that when I issue commands remotely over SSH during deployment things will just work.

  2. Greg Hurrell 2010-09-12T00:01:40Z
    # wget http://jruby.org.s3.amazonaws.com/downloads/1.5.2/jruby-bin-1.5.2.tar.gz
    # tar xzvf jruby-bin-1.5.2.tar.gz -C /usr/local
    # cd /usr/local
    # ln -s jruby-1.5.2 jruby

    As for SSH and the PATH, the man page says it is "Set to the default PATH, as specified when compiling ssh", so I probably have to issue my commands using env like this:

    $ ssh user@server "sh -c 'cd $DEPLOY && env PATH=/usr/local/jruby/bin:\$PATH bin/rspec -f progress spec'"

    No idea if escaping the remote $PATH like that will work; will have to try it out.

  3. Greg Hurrell 2010-09-12T00:04:38Z

    Will have to keep researching:

    $ ssh user@server "sh -c 'env PATH=/usr/local/jruby/bin:\$PATH echo \$PATH'"
    /usr/local/bin:/bin:/usr/bin

    Unfortunately will have to leave it for another day though.

  4. Greg Hurrell 2010-09-12T00:13:06Z
    # export PATH=/usr/local/jruby/bin:$PATH # for now
    # jruby -S gem update --system
    # jruby -S gem install bundler
  5. Greg Hurrell 2010-09-12T00:30:27Z

    Just did a manual test (bin/rspec spec) on the server with JRuby in the PATH and the acceptance specs (which depend on JRuby) all pass, bar one, which I'll have to investigate:

     1) Logging in to the site: dynamic "log in"/"log out" links (when logged out)
        Failure/Error: page.should have_content('log in')
        expected #has_content?("log in") to return true, got false
        # ./spec/acceptance/sessions_spec.rb:47

    Surprised, actually, seeing as I didn't even have to run bundle install under JRuby... Although running bundle show does complain with:

    Could not find bouncy-castle-java-1.5.0145.2 in any of the sources

    Ditto for jruby -S bundle show.

    (Compare that with my local machine where I get a long list for bundle show and the shorter JRuby platform list for jruby -S bundle show.)

    Try:

    $ jruby -S bundle install --quiet --deployment --local --binstubs --path /path/to/shared/bundle

    And bundle check, jruby -S bundle check, bundle show, and jruby -S bundle show all work without errors, but bundle show (running under MRI) only shows the JRuby gems.

    Re-running:

    $ bundle install --quiet --deployment --local --binstubs --path /path/to/shared/bundle
    $ bundle show

    Doesn't fix the short listings.

    Re-ran the acceptance specs and running bundle install under JRuby didn't fix that one broken spec. Will still have to investigate.

  6. Greg Hurrell 2010-09-12T07:51:44Z

    Ok, there are two ways of setting up the PATH:

    $ ssh user@server "sh -c 'cd /path/to/deploy/current && env PATH=/usr/local/jruby/bin:\$PATH bin/rspec -f progress spec'"

    Does work.

    Adding this hack to the spec/spec_helper.rb does also:

    unless ENV['PATH'].to_s =~ /jruby/
      ENV['PATH'] = ['/usr/local/jruby/bin', ENV['PATH']].join(':')
    end

    Troubleshooting that spec failure is not easy, however, as Capybara's save_and_open_page method doesn't work on the server (obviously it can't open, but it appears that it doesn't save either).

  7. Greg Hurrell 2010-09-12T08:00:16Z

    I take back what I said about save_and_open_page. Looks like it was changed recently to write the files to RAILS_ROOT/tmp/capybara/.

  8. Greg Hurrell 2010-09-12T08:06:20Z

    Status changed:

    • From: new
    • To: closed
Add a comment

Comments are now closed for this issue.

  • contact
  • legal

Menu

  • Blog
  • Wiki
  • Issues
  • Snippets