Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
Finish ruby2.0 compatiblity in testing setup.
Browse files Browse the repository at this point in the history
* Split out gemfiles in travis for explicit matrix.
* Update gemfiles for ruby2.0 compatibility
** rails/rails#9406 <- makes rails 3.2 Ruby 2.0 compatible, meaning the first version we'll test with and support is this
** Use older version of rubygems for rails 2 compatibility
* Update dummy rails3 test app and rails loading tests.
* Update passenger test will fallback Passenger SIGKILL: MySQL + Passenger 2 + Rails 2.3 + Ruby 1.8.7 seem to not close connections.
  • Loading branch information
phillbaker committed Oct 16, 2013
1 parent 62b20eb commit 487e74e
Show file tree
Hide file tree
Showing 13 changed files with 216 additions and 122 deletions.
52 changes: 47 additions & 5 deletions .travis.yml
@@ -1,23 +1,65 @@
language: ruby
bundler_args: --without development
script: 'rake appraisal test'
script: 'bundle exec rake test'
services:
- mongodb
rvm:
- 1.8.7
- 1.9.3
- 2.0.0
- ruby-head
env:
- DB=mongodb
- DB=redis
- DB=mysql
#- DB=postgres
gemfile:
- Gemfile
- gemfiles/rails3.gemfile
- gemfiles/rails31.gemfile
- gemfiles/rails32.gemfile
before_script:
- if [[ "`basename $BUNDLE_GEMFILE`" == "Gemfile" ]]; then rvm rubygems 1.8.25; fi # Rubygems 2.0.x fails with Rails 2.3
- "mysql -e 'create database vanity_test;' >/dev/null"
- "rake appraisal:install"
#- "psql -c 'create database vanity_test;' -U postgres >/dev/null"
#- if [[ "$DB" == "pgsql" ]]; then psql -c 'create database vanity_test;' -U postgres >/dev/null; fi
matrix:
allow_failures:
exclude:
# Rails 2 is not officially supported on Ruby 1.9.3
- rvm: 1.9.3
env: DB=mongodb
gemfile: Gemfile
- rvm: 1.9.3
env: DB=redis
gemfile: Gemfile
- rvm: 1.9.3
env: DB=mysql
gemfile: Gemfile
# Rails <= 3.2 is not officially supported on Ruby 2.0.0
- rvm: 2.0.0
env: DB=mongodb
gemfile: Gemfile
- rvm: 2.0.0
env: DB=redis
gemfile: Gemfile
- rvm: 2.0.0
env: DB=mysql
gemfile: Gemfile
- rvm: 2.0.0
env: DB=mongodb
gemfile: gemfiles/rails3.gemfile
- rvm: 2.0.0
env: DB=redis
gemfile: gemfiles/rails3.gemfile
- rvm: 2.0.0
env: DB=mysql
gemfile: gemfiles/rails3.gemfile
allow_failures:
- rvm: ruby-head
- rvm: 2.0.0
env: DB=mongodb
gemfile: gemfiles/rails31.gemfile
- rvm: 2.0.0
env: DB=redis
gemfile: gemfiles/rails31.gemfile
- rvm: 2.0.0
env: DB=mysql
gemfile: gemfiles/rails31.gemfile
4 changes: 3 additions & 1 deletion Appraisals
@@ -1,15 +1,17 @@
appraise "rails3" do
gem "rails", "3.0.11"
gem "fastthread", :git => "git://github.com/zoltankiss/fastthread.git", :platforms => :mri_20
gem "passenger", "~>3.0"
end

appraise "rails31" do
gem "rails", "3.1.3"
gem "fastthread", :git => "git://github.com/zoltankiss/fastthread.git", :platforms => :mri_20
gem "passenger", "~>3.0"
end

appraise "rails32" do
gem "rails", "3.2.1"
gem "fastthread", :git => "git://github.com/zoltankiss/fastthread.git", :platforms => :mri_20
gem "passenger", "~>3.0"
end

31 changes: 21 additions & 10 deletions Gemfile
@@ -1,22 +1,33 @@
source 'https://rubygems.org'
gemspec

gem "appraisal"
# Frameworks
gem "rack"
gem "rails", "~>2.3.8"

# Servers
gem "passenger", "~>2.0"

# Persistence
gem "bson_ext"
gem "garb"
gem "mocha"
gem "mongo"
gem "bson_ext"
gem "mysql"
gem "passenger", "~>2.0"
gem "pg"
gem "rails", "~>2.3.8"
gem "rack"
gem "shoulda"
gem "timecop"
gem "webmock"

# APIs
gem "garb"

# Compatibility
gem "SystemTimer", "1.2.3", :platforms => :mri_18

# Testing
gem "appraisal"

gem "mocha", :require=>false
gem "shoulda", :require=>false # Requires test/unit
gem "timecop", :require=>false
gem "webmock", :require=>false

group :development do
gem "jekyll"
gem "rake"
Expand Down
17 changes: 9 additions & 8 deletions gemfiles/rails3.gemfile
Expand Up @@ -2,19 +2,20 @@

source "https://rubygems.org"

gem "appraisal"
gem "garb"
gem "mocha"
gem "mongo"
gem "rack"
gem "bson_ext"
gem "mongo"
gem "mysql"
gem "pg"
gem "rack"
gem "shoulda"
gem "timecop"
gem "webmock"
gem "garb"
gem "SystemTimer", "1.2.3", :platforms=>:mri_18
gem "appraisal"
gem "mocha", :require=>false
gem "shoulda", :require=>false
gem "timecop", :require=>false
gem "webmock", :require=>false
gem "rails", "3.0.11"
gem "fastthread", :git=>"git://github.com/zoltankiss/fastthread.git", :platforms=>:mri_20
gem "passenger", "~>3.0"

gemspec :path=>"../"
8 changes: 7 additions & 1 deletion gemfiles/rails3.gemfile.lock
@@ -1,3 +1,9 @@
GIT
remote: git://github.com/zoltankiss/fastthread.git
revision: 56e6ce7c1780797a354d5befe9a9a9869bbc7e3e
specs:
fastthread (1.0.7)

PATH
remote: /Users/phill/Development/ruby/vanity
specs:
Expand Down Expand Up @@ -49,7 +55,6 @@ GEM
daemon_controller (1.0.0)
erubis (2.6.6)
abstract (>= 1.0.0)
fastthread (1.0.7)
garb (0.9.1)
activesupport (>= 2.2.0)
crack (>= 0.1.6)
Expand Down Expand Up @@ -121,6 +126,7 @@ DEPENDENCIES
SystemTimer (= 1.2.3)
appraisal
bson_ext
fastthread!
garb
mocha
mongo
Expand Down
17 changes: 9 additions & 8 deletions gemfiles/rails31.gemfile
Expand Up @@ -2,19 +2,20 @@

source "https://rubygems.org"

gem "appraisal"
gem "garb"
gem "mocha"
gem "mongo"
gem "rack"
gem "bson_ext"
gem "mongo"
gem "mysql"
gem "pg"
gem "rack"
gem "shoulda"
gem "timecop"
gem "webmock"
gem "garb"
gem "SystemTimer", "1.2.3", :platforms=>:mri_18
gem "appraisal"
gem "mocha", :require=>false
gem "shoulda", :require=>false
gem "timecop", :require=>false
gem "webmock", :require=>false
gem "rails", "3.1.3"
gem "fastthread", :git=>"git://github.com/zoltankiss/fastthread.git", :platforms=>:mri_20
gem "passenger", "~>3.0"

gemspec :path=>"../"
8 changes: 7 additions & 1 deletion gemfiles/rails31.gemfile.lock
@@ -1,3 +1,9 @@
GIT
remote: git://github.com/zoltankiss/fastthread.git
revision: 56e6ce7c1780797a354d5befe9a9a9869bbc7e3e
specs:
fastthread (1.0.7)

PATH
remote: /Users/phill/Development/ruby/vanity
specs:
Expand Down Expand Up @@ -49,7 +55,6 @@ GEM
crack (0.3.1)
daemon_controller (1.0.0)
erubis (2.7.0)
fastthread (1.0.7)
garb (0.9.1)
activesupport (>= 2.2.0)
crack (>= 0.1.6)
Expand Down Expand Up @@ -132,6 +137,7 @@ DEPENDENCIES
SystemTimer (= 1.2.3)
appraisal
bson_ext
fastthread!
garb
mocha
mongo
Expand Down
17 changes: 9 additions & 8 deletions gemfiles/rails32.gemfile
Expand Up @@ -2,19 +2,20 @@

source "https://rubygems.org"

gem "appraisal"
gem "garb"
gem "mocha"
gem "mongo"
gem "rack"
gem "bson_ext"
gem "mongo"
gem "mysql"
gem "pg"
gem "rack"
gem "shoulda"
gem "timecop"
gem "webmock"
gem "garb"
gem "SystemTimer", "1.2.3", :platforms=>:mri_18
gem "appraisal"
gem "mocha", :require=>false
gem "shoulda", :require=>false
gem "timecop", :require=>false
gem "webmock", :require=>false
gem "rails", "3.2.1"
gem "fastthread", :git=>"git://github.com/zoltankiss/fastthread.git", :platforms=>:mri_20
gem "passenger", "~>3.0"

gemspec :path=>"../"
8 changes: 7 additions & 1 deletion gemfiles/rails32.gemfile.lock
@@ -1,3 +1,9 @@
GIT
remote: git://github.com/zoltankiss/fastthread.git
revision: 56e6ce7c1780797a354d5befe9a9a9869bbc7e3e
specs:
fastthread (1.0.7)

PATH
remote: /Users/phill/Development/ruby/vanity
specs:
Expand Down Expand Up @@ -48,7 +54,6 @@ GEM
crack (0.3.1)
daemon_controller (1.0.0)
erubis (2.7.0)
fastthread (1.0.7)
garb (0.9.1)
activesupport (>= 2.2.0)
crack (>= 0.1.6)
Expand Down Expand Up @@ -130,6 +135,7 @@ DEPENDENCIES
SystemTimer (= 1.2.3)
appraisal
bson_ext
fastthread!
garb
mocha
mongo
Expand Down
10 changes: 4 additions & 6 deletions test/dummy/config/boot.rb
@@ -1,10 +1,8 @@
require 'rubygems'
gemfile = File.expand_path('../../../../Gemfile', __FILE__)

if File.exist?(gemfile)
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
end
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)

require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])

$:.unshift File.expand_path('../../../../lib', __FILE__)
2 changes: 1 addition & 1 deletion test/dummy/config/environments/development.rb
Expand Up @@ -11,7 +11,7 @@

# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_view.debug_rjs = true
config.action_view.debug_rjs = true if ActionView::Base.respond_to?(:debug_rjs=)
config.action_controller.perform_caching = false

# Don't care if the mailer can't send
Expand Down
8 changes: 7 additions & 1 deletion test/passenger_test.rb
Expand Up @@ -16,10 +16,14 @@ def setup
@server.start
Thread.pass until @server.started?
app_root = File.expand_path("myapp", File.dirname(__FILE__))
@app = @server.spawn_application "app_root"=>app_root, "spawn_method"=>"smart-lv2"
@app = @server.spawn_application "app_root"=>app_root, "spawn_method"=>"smart"
end

def test_reconnect
# When using AR adapter, we're not responsible to reconnect, and we're going
# to get the same "connect" (AR connection handler) either way.
# return if defined?(Vanity::Adapters::ActiveRecordAdapter) && Vanity::Adapters::ActiveRecordAdapter === Vanity.playground.connection

sleep 0.1
case @app.listen_socket_type
when "tcp" ; socket = TCPSocket.new(*@app.listen_socket_name.split(":"))
Expand All @@ -38,7 +42,9 @@ def test_reconnect

def teardown
super
@server.cleanup
@server.stop
Process.kill('SIGKILL', @app.pid.to_i) # Just in case...KIDS, GET OUT OF THE POOL!
File.unlink "test/myapp/config/vanity.yml"
end
end
Expand Down

0 comments on commit 487e74e

Please sign in to comment.