-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial work on appraisal and rails integration testing, #3241
- Loading branch information
Showing
12 changed files
with
387 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
appraise "rails-4" do | ||
gem "rails", "4.2.7" | ||
end | ||
|
||
appraise "rails-5" do | ||
gem "rails", "5.0.0" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'appraisal' | ||
gem 'pry' | ||
gem 'sidekiq', :path => '..' | ||
gem 'rails', '5.0.0' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,32 @@ | ||
#!/usr/bin/env rake | ||
# Add your own tasks in files placed in lib/tasks ending in .rake, | ||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | ||
|
||
require File.expand_path('../config/application', __FILE__) | ||
|
||
Myapp::Application.load_tasks | ||
task :test do | ||
require 'timeout' | ||
|
||
task :load_jobs => :environment do | ||
require 'sidekiq/api' | ||
Sidekiq::Queue.new.clear | ||
%(production development).each do |env| | ||
pid = fork do | ||
ENV['RAILS_ENV'] = env | ||
puts eval(File.read("integration_test.rb")) | ||
end | ||
|
||
50_000.times do |x| | ||
EmptyWorker.perform_async | ||
begin | ||
Timeout.timeout(20) do | ||
Process.wait | ||
end | ||
rescue Timeout::Error | ||
Process.kill 9, pid | ||
# collect status so it doesn't stick around as zombie process | ||
Process.wait pid | ||
end | ||
puts "#{server} child exited, pid = #{pid}" | ||
Process.wait4(pid) | ||
end | ||
end | ||
|
||
if !ENV["APPRAISAL_INITIALIZED"] && !ENV["TRAVIS"] | ||
task :default => :appraisal | ||
else | ||
task :default => :test | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class ApplicationJob < ActiveJob::Base | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class ExitJob < ApplicationJob | ||
queue_as :default | ||
|
||
def perform(*args) | ||
Thread.new do | ||
sleep 0.1 | ||
exit(0) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class Exiter | ||
def self.run | ||
Thread.new do | ||
sleep 0.1 | ||
exit(0) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class ExitWorker | ||
include Sidekiq::Worker | ||
|
||
def perform | ||
puts Rails.version | ||
Thread.new do | ||
sleep 0.1 | ||
exit(0) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "appraisal" | ||
gem "pry" | ||
gem "sidekiq", :path => "../.." | ||
gem "rails", "4.2.7" | ||
|
||
platforms :ruby do | ||
gem "sqlite3" | ||
gem "redis-namespace" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
PATH | ||
remote: ../.. | ||
specs: | ||
sidekiq (4.2.6) | ||
concurrent-ruby (~> 1.0) | ||
connection_pool (~> 2.2, >= 2.2.0) | ||
rack-protection (>= 1.5.0) | ||
redis (~> 3.2, >= 3.2.1) | ||
|
||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
actionmailer (4.2.7) | ||
actionpack (= 4.2.7) | ||
actionview (= 4.2.7) | ||
activejob (= 4.2.7) | ||
mail (~> 2.5, >= 2.5.4) | ||
rails-dom-testing (~> 1.0, >= 1.0.5) | ||
actionpack (4.2.7) | ||
actionview (= 4.2.7) | ||
activesupport (= 4.2.7) | ||
rack (~> 1.6) | ||
rack-test (~> 0.6.2) | ||
rails-dom-testing (~> 1.0, >= 1.0.5) | ||
rails-html-sanitizer (~> 1.0, >= 1.0.2) | ||
actionview (4.2.7) | ||
activesupport (= 4.2.7) | ||
builder (~> 3.1) | ||
erubis (~> 2.7.0) | ||
rails-dom-testing (~> 1.0, >= 1.0.5) | ||
rails-html-sanitizer (~> 1.0, >= 1.0.2) | ||
activejob (4.2.7) | ||
activesupport (= 4.2.7) | ||
globalid (>= 0.3.0) | ||
activemodel (4.2.7) | ||
activesupport (= 4.2.7) | ||
builder (~> 3.1) | ||
activerecord (4.2.7) | ||
activemodel (= 4.2.7) | ||
activesupport (= 4.2.7) | ||
arel (~> 6.0) | ||
activesupport (4.2.7) | ||
i18n (~> 0.7) | ||
json (~> 1.7, >= 1.7.7) | ||
minitest (~> 5.1) | ||
thread_safe (~> 0.3, >= 0.3.4) | ||
tzinfo (~> 1.1) | ||
appraisal (2.1.0) | ||
bundler | ||
rake | ||
thor (>= 0.14.0) | ||
arel (6.0.3) | ||
builder (3.2.2) | ||
coderay (1.1.1) | ||
concurrent-ruby (1.0.2) | ||
connection_pool (2.2.0) | ||
erubis (2.7.0) | ||
globalid (0.3.7) | ||
activesupport (>= 4.1.0) | ||
i18n (0.7.0) | ||
json (1.8.3) | ||
loofah (2.0.3) | ||
nokogiri (>= 1.5.9) | ||
mail (2.6.4) | ||
mime-types (>= 1.16, < 4) | ||
method_source (0.8.2) | ||
mime-types (3.1) | ||
mime-types-data (~> 3.2015) | ||
mime-types-data (3.2016.0521) | ||
mini_portile2 (2.1.0) | ||
minitest (5.9.1) | ||
nokogiri (1.6.8.1) | ||
mini_portile2 (~> 2.1.0) | ||
pry (0.10.4) | ||
coderay (~> 1.1.0) | ||
method_source (~> 0.8.1) | ||
slop (~> 3.4) | ||
rack (1.6.4) | ||
rack-protection (1.5.3) | ||
rack | ||
rack-test (0.6.3) | ||
rack (>= 1.0) | ||
rails (4.2.7) | ||
actionmailer (= 4.2.7) | ||
actionpack (= 4.2.7) | ||
actionview (= 4.2.7) | ||
activejob (= 4.2.7) | ||
activemodel (= 4.2.7) | ||
activerecord (= 4.2.7) | ||
activesupport (= 4.2.7) | ||
bundler (>= 1.3.0, < 2.0) | ||
railties (= 4.2.7) | ||
sprockets-rails | ||
rails-deprecated_sanitizer (1.0.3) | ||
activesupport (>= 4.2.0.alpha) | ||
rails-dom-testing (1.0.7) | ||
activesupport (>= 4.2.0.beta, < 5.0) | ||
nokogiri (~> 1.6.0) | ||
rails-deprecated_sanitizer (>= 1.0.1) | ||
rails-html-sanitizer (1.0.3) | ||
loofah (~> 2.0) | ||
railties (4.2.7) | ||
actionpack (= 4.2.7) | ||
activesupport (= 4.2.7) | ||
rake (>= 0.8.7) | ||
thor (>= 0.18.1, < 2.0) | ||
rake (11.3.0) | ||
redis (3.3.1) | ||
redis-namespace (1.5.2) | ||
redis (~> 3.0, >= 3.0.4) | ||
slop (3.6.0) | ||
sprockets (3.7.0) | ||
concurrent-ruby (~> 1.0) | ||
rack (> 1, < 3) | ||
sprockets-rails (3.2.0) | ||
actionpack (>= 4.0) | ||
activesupport (>= 4.0) | ||
sprockets (>= 3.0.0) | ||
sqlite3 (1.3.11) | ||
thor (0.19.1) | ||
thread_safe (0.3.5) | ||
tzinfo (1.2.2) | ||
thread_safe (~> 0.1) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
appraisal | ||
pry | ||
rails (= 4.2.7) | ||
redis-namespace | ||
sidekiq! | ||
sqlite3 | ||
|
||
BUNDLED WITH | ||
1.12.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "appraisal" | ||
gem "pry" | ||
gem "sidekiq", :path => "../.." | ||
gem "rails", "5.0.0" | ||
|
||
platforms :ruby do | ||
gem "sqlite3" | ||
gem "redis-namespace" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
PATH | ||
remote: ../.. | ||
specs: | ||
sidekiq (4.2.6) | ||
concurrent-ruby (~> 1.0) | ||
connection_pool (~> 2.2, >= 2.2.0) | ||
rack-protection (>= 1.5.0) | ||
redis (~> 3.2, >= 3.2.1) | ||
|
||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
actioncable (5.0.0) | ||
actionpack (= 5.0.0) | ||
nio4r (~> 1.2) | ||
websocket-driver (~> 0.6.1) | ||
actionmailer (5.0.0) | ||
actionpack (= 5.0.0) | ||
actionview (= 5.0.0) | ||
activejob (= 5.0.0) | ||
mail (~> 2.5, >= 2.5.4) | ||
rails-dom-testing (~> 2.0) | ||
actionpack (5.0.0) | ||
actionview (= 5.0.0) | ||
activesupport (= 5.0.0) | ||
rack (~> 2.0) | ||
rack-test (~> 0.6.3) | ||
rails-dom-testing (~> 2.0) | ||
rails-html-sanitizer (~> 1.0, >= 1.0.2) | ||
actionview (5.0.0) | ||
activesupport (= 5.0.0) | ||
builder (~> 3.1) | ||
erubis (~> 2.7.0) | ||
rails-dom-testing (~> 2.0) | ||
rails-html-sanitizer (~> 1.0, >= 1.0.2) | ||
activejob (5.0.0) | ||
activesupport (= 5.0.0) | ||
globalid (>= 0.3.6) | ||
activemodel (5.0.0) | ||
activesupport (= 5.0.0) | ||
activerecord (5.0.0) | ||
activemodel (= 5.0.0) | ||
activesupport (= 5.0.0) | ||
arel (~> 7.0) | ||
activesupport (5.0.0) | ||
concurrent-ruby (~> 1.0, >= 1.0.2) | ||
i18n (~> 0.7) | ||
minitest (~> 5.1) | ||
tzinfo (~> 1.1) | ||
appraisal (2.1.0) | ||
bundler | ||
rake | ||
thor (>= 0.14.0) | ||
arel (7.1.4) | ||
builder (3.2.2) | ||
coderay (1.1.1) | ||
concurrent-ruby (1.0.2) | ||
connection_pool (2.2.0) | ||
erubis (2.7.0) | ||
globalid (0.3.7) | ||
activesupport (>= 4.1.0) | ||
i18n (0.7.0) | ||
loofah (2.0.3) | ||
nokogiri (>= 1.5.9) | ||
mail (2.6.4) | ||
mime-types (>= 1.16, < 4) | ||
method_source (0.8.2) | ||
mime-types (3.1) | ||
mime-types-data (~> 3.2015) | ||
mime-types-data (3.2016.0521) | ||
mini_portile2 (2.1.0) | ||
minitest (5.9.1) | ||
nio4r (1.2.1) | ||
nokogiri (1.6.8.1) | ||
mini_portile2 (~> 2.1.0) | ||
pry (0.10.4) | ||
coderay (~> 1.1.0) | ||
method_source (~> 0.8.1) | ||
slop (~> 3.4) | ||
rack (2.0.1) | ||
rack-protection (1.5.3) | ||
rack | ||
rack-test (0.6.3) | ||
rack (>= 1.0) | ||
rails (5.0.0) | ||
actioncable (= 5.0.0) | ||
actionmailer (= 5.0.0) | ||
actionpack (= 5.0.0) | ||
actionview (= 5.0.0) | ||
activejob (= 5.0.0) | ||
activemodel (= 5.0.0) | ||
activerecord (= 5.0.0) | ||
activesupport (= 5.0.0) | ||
bundler (>= 1.3.0, < 2.0) | ||
railties (= 5.0.0) | ||
sprockets-rails (>= 2.0.0) | ||
rails-dom-testing (2.0.1) | ||
activesupport (>= 4.2.0, < 6.0) | ||
nokogiri (~> 1.6.0) | ||
rails-html-sanitizer (1.0.3) | ||
loofah (~> 2.0) | ||
railties (5.0.0) | ||
actionpack (= 5.0.0) | ||
activesupport (= 5.0.0) | ||
method_source | ||
rake (>= 0.8.7) | ||
thor (>= 0.18.1, < 2.0) | ||
rake (11.3.0) | ||
redis (3.3.1) | ||
redis-namespace (1.5.2) | ||
redis (~> 3.0, >= 3.0.4) | ||
slop (3.6.0) | ||
sprockets (3.7.0) | ||
concurrent-ruby (~> 1.0) | ||
rack (> 1, < 3) | ||
sprockets-rails (3.2.0) | ||
actionpack (>= 4.0) | ||
activesupport (>= 4.0) | ||
sprockets (>= 3.0.0) | ||
sqlite3 (1.3.11) | ||
thor (0.19.1) | ||
thread_safe (0.3.5) | ||
tzinfo (1.2.2) | ||
thread_safe (~> 0.1) | ||
websocket-driver (0.6.4) | ||
websocket-extensions (>= 0.1.0) | ||
websocket-extensions (0.1.2) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
appraisal | ||
pry | ||
rails (= 5.0.0) | ||
redis-namespace | ||
sidekiq! | ||
sqlite3 | ||
|
||
BUNDLED WITH | ||
1.12.5 |
Oops, something went wrong.