Skip to content

Commit

Permalink
update the integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shime committed Nov 8, 2012
1 parent 428f3b3 commit 73edcf8
Show file tree
Hide file tree
Showing 27 changed files with 958 additions and 754 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -12,7 +12,6 @@ tags
doc
pkg

*emfile.lock
.bundle

*.rbc
Expand Down
126 changes: 126 additions & 0 deletions Gemfile.lock
@@ -0,0 +1,126 @@
PATH
remote: .
specs:
airbrake (3.1.6)
builder
girl_friday

GEM
remote: http://rubygems.org/
specs:
addressable (2.3.2)
appraisal (0.5.1)
bundler
rake
aruba (0.4.6)
bcat (>= 0.6.1)
childprocess (>= 0.2.0)
cucumber (>= 1.0.2)
rdiscount (>= 1.6.8)
rspec (>= 2.6.0)
bcat (0.6.2)
rack (~> 1.0)
bourne (1.2.0)
mocha (= 0.12.3)
builder (3.1.4)
capistrano (2.13.5)
highline
net-scp (>= 1.0.0)
net-sftp (>= 2.0.0)
net-ssh (>= 2.0.14)
net-ssh-gateway (>= 1.1.0)
capybara (1.1.3)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 0.1.4)
childprocess (0.3.6)
ffi (~> 1.0, >= 1.0.6)
connection_pool (0.9.2)
cucumber (1.2.1)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.11.0)
json (>= 1.4.6)
cucumber-rails (1.1.1)
capybara (>= 1.1.1)
cucumber (>= 1.1.0)
nokogiri (>= 1.5.0)
diff-lcs (1.1.3)
fakeweb (1.3.0)
ffi (1.1.5)
gherkin (2.11.5)
json (>= 1.4.6)
girl_friday (0.10.0)
connection_pool (~> 0.9.0)
highline (1.6.15)
json (1.7.5)
libwebsocket (0.1.5)
addressable
metaclass (0.0.1)
mime-types (1.19)
mocha (0.12.3)
metaclass (~> 0.0.1)
multi_json (1.3.7)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
net-sftp (2.0.5)
net-ssh (>= 2.0.9)
net-ssh (2.6.1)
net-ssh-gateway (1.1.0)
net-ssh (>= 1.99.1)
nokogiri (1.5.5)
rack (1.4.1)
rack-protection (1.2.0)
rack
rack-test (0.6.2)
rack (>= 1.0)
rake (0.9.2.2)
rdiscount (1.6.8)
rspec (2.6.0)
rspec-core (~> 2.6.0)
rspec-expectations (~> 2.6.0)
rspec-mocks (~> 2.6.0)
rspec-core (2.6.4)
rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.6.0)
rspec-rails (1.3.2)
rack (>= 1.0.0)
rspec (>= 1.3.0)
rubyzip (0.9.9)
selenium-webdriver (2.26.0)
childprocess (>= 0.2.5)
libwebsocket (~> 0.1.3)
multi_json (~> 1.0)
rubyzip
sham_rack (1.3.4)
rack
shoulda (2.11.3)
sinatra (1.3.3)
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
tilt (~> 1.3, >= 1.3.3)
tilt (1.3.3)
xpath (0.1.4)
nokogiri (~> 1.3)

PLATFORMS
ruby

DEPENDENCIES
airbrake!
appraisal
aruba
bourne (>= 1.0)
capistrano
cucumber-rails (~> 1.1.1)
fakeweb (~> 1.3.0)
nokogiri (~> 1.5.0)
rspec (~> 2.6.0)
rspec-rails
sham_rack (~> 1.3.0)
shoulda (~> 2.11.3)
sinatra
61 changes: 61 additions & 0 deletions LICENSE
@@ -0,0 +1,61 @@
This product includes jquery written by John Resig
and distributed under an MIT license.
See https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt

Copyright (c) 2011 John Resig, http://jquery.com/

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


All other components of this product are
Copyright (c) 2007-2012 Exceptional Software Inc DBA Airbrake.io. All rights reserved.

Subject to the terms of this notice, Exceptional Software Inc grants you a
nonexclusive, nontransferable license, without the right to
sublicense, to (a) install and execute one copy of these files on any
number of workstations owned or controlled by you and (b) distribute
verbatim copies of these files to third parties. As a condition to the
foregoing grant, you must provide this notice along with each copy you
distribute and you must not remove, alter, or obscure this notice. All
other use, reproduction, modification, distribution, or other
exploitation of these files is strictly prohibited, except as may be set
forth in a separate written license agreement between you and Exceptional
Software Inc. The terms of any such license agreement will control over this
notice. The license stated above will be automatically terminated and
revoked if you exceed its scope or violate any of the terms of this
notice.

This License does not grant permission to use the trade names,
trademarks, service marks, or product names of Exceptional Software Inc,
DBA Airbrake, Exceptional, Airbrake.io, Exceptional.io except as
required for reasonable and customary use in describing the origin
of this file and reproducing the content of this notice. You may
not mark or brand this file with any trade name, trademarks,
servicemarks, or product names other than the original brand
(if any)provided by Exceptional.

Unless otherwise expressly agreed by Exceptional Software Inc, in a
separate written license agreement, these files are provided AS IS,
WITHOUT WARRANTY OF ANY KIND, including without any implied warranties
of MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, or NON-INFRINGEMENT.
As a condition to your use of these files, you are solely responsible for
such use. Exceptional Software Inc will have no liability to you for direct,
indirect, consequential, incidental, special, or punitive damages or
for lost profits or data.
22 changes: 0 additions & 22 deletions MIT-LICENSE

This file was deleted.

117 changes: 2 additions & 115 deletions Rakefile
Expand Up @@ -12,9 +12,6 @@ rescue LoadError
end
require './lib/airbrake/version'

FEATURES = ["sinatra","rack","metal","user_informer","rake"]

desc 'Default: run unit tests.'
task :default do
if ENV['BUNDLE_GEMFILE'] =~ /gemfiles/
exec 'rake cucumber'
Expand All @@ -23,23 +20,10 @@ task :default do
end
end


task :appraise do
Rake::Task["bundle:bundler"].execute
task :appraise => ["appraisal:install"] do
exec 'rake appraisal cucumber'
Rake::Task['appraisal:install'].execute
end

namespace :bundle do
task :bundler do
path = `bundle show rake`.split("gems").first
command = "gem install -i #{path} bundler"
system command
end
end



desc "Clean out the tmp directory"
task :clean do
exec "rm -rf tmp"
Expand Down Expand Up @@ -144,105 +128,8 @@ desc "Clean files generated by rake tasks"
task :clobber => [:clobber_rdoc, :clobber_package]

LOCAL_GEM_ROOT = File.join(GEM_ROOT, 'tmp', 'local_gems').freeze
RAILS_VERSIONS = IO.read('SUPPORTED_RAILS_VERSIONS').strip.split("\n")
LOCAL_GEMS =
[
["rack","1.3.2"],
] +
RAILS_VERSIONS.collect { |version| ['rails', version] } +
[
['sham_rack', nil],
['capistrano', nil],
['sqlite3-ruby', nil],
["therubyracer",nil],
["sinatra",nil]
]


desc "Vendor test gems: Run this once to prepare your test environment"
task :vendor_test_gems do
old_gem_path = ENV['GEM_PATH']
old_gem_home = ENV['GEM_HOME']
ENV['GEM_PATH'] = LOCAL_GEM_ROOT
ENV['GEM_HOME'] = LOCAL_GEM_ROOT

LOCAL_GEMS.each do |gem_name, version|
gem_file_pattern = [gem_name, version || '*'].compact.join('-')
version_option = version ? "-v #{version}" : ''
pattern = File.join(LOCAL_GEM_ROOT, 'gems', "#{gem_file_pattern}")
existing = Dir.glob(pattern).first
if existing
puts "\nskipping #{gem_name} since it's already vendored," +
"remove it from the tmp directory first."
next
end

command = "gem install -i #{LOCAL_GEM_ROOT} --no-ri --no-rdoc --backtrace #{version_option} #{gem_name}"
puts "Vendoring #{gem_file_pattern}..."
unless system("#{command} 2>&1")
puts "Command failed: #{command}"
exit(1)
end
end

ENV['GEM_PATH'] = old_gem_path
ENV['GEM_HOME'] = old_gem_home
end

Cucumber::Rake::Task.new(:cucumber) do |t|
t.fork = true
end




def run_rails_cucumber_task(version, additional_cucumber_args)
puts "Testing Rails #{version}"
if version.empty?
raise "No Rails version specified - make sure ENV['RAILS_VERSION'] is set, e.g. with `rake cucumber:rails:all`"
end
ENV['RAILS_VERSION'] = version
cmd = "cucumber --format #{ENV['CUCUMBER_FORMAT'] || 'progress'} #{additional_cucumber_args} features/rails.feature features/rails_with_js_notifier.feature"
puts "Running command: #{cmd}"
system(cmd)
end

def define_rails_cucumber_tasks(additional_cucumber_args = '')
namespace :rails do
RAILS_VERSIONS.each do |version|
desc "Test integration of the gem with Rails #{version}"
task version => [:vendor_test_gems] do
exit 1 unless run_rails_cucumber_task(version, additional_cucumber_args)
end
end

desc "Test integration of the gem with all Rails versions"
task :all do
results = RAILS_VERSIONS.map do |version|
run_rails_cucumber_task(version, additional_cucumber_args)
end

exit 1 unless results.all?
end
end
end

namespace :cucumber do
namespace :wip do
define_rails_cucumber_tasks('--tags @wip')
end

define_rails_cucumber_tasks

rule /#{"(" + FEATURES.join("|") + ")"}/ do |t|
framework = t.name
desc "Test integration of the gem with #{framework}"
task framework.to_sym do
puts "Testing #{framework.split(":").last}..."
cmd = "cucumber --format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features/#{framework.split(":").last}.feature"
puts "Running command: #{cmd}"
system(cmd)
end
end

t.cucumber_opts = "--tags ~@wip --format progress"
end
7 changes: 3 additions & 4 deletions airbrake.gemspec
Expand Up @@ -8,27 +8,26 @@ Gem::Specification.new do |s|
s.summary = %q{Send your application errors to our hosted service and reclaim your inbox.}

s.require_paths = ["lib"]
s.executables << "airbrake"
s.executables << "airbrake"
s.files = Dir["{generators/**/*,lib/**/*,rails/**/*,resources/*,script/*}"] +
%w(airbrake.gemspec CHANGELOG Gemfile Guardfile INSTALL MIT-LICENSE Rakefile README_FOR_HEROKU_ADDON.md README.md TESTING.md SUPPORTED_RAILS_VERSIONS install.rb)
s.test_files = Dir.glob("{test,spec,features}/**/*")

s.add_runtime_dependency("builder")
s.add_runtime_dependency("girl_friday")

s.add_development_dependency("bundler")
s.add_development_dependency("bourne", ">= 1.0")
s.add_development_dependency("cucumber-rails","~> 1.1.1")
s.add_development_dependency("fakeweb", "~> 1.3.0")
s.add_development_dependency("nokogiri", "~> 1.5.0")
s.add_development_dependency("rspec", "~> 2.6.0")
s.add_development_dependency("sham_rack", "~> 1.3.0")
s.add_development_dependency("shoulda", "~> 2.11.3")
s.add_development_dependency("capistrano", "~> 2.8.0")
s.add_development_dependency("capistrano")
s.add_development_dependency("aruba")
s.add_development_dependency("appraisal")
s.add_development_dependency("simplecov")
s.add_development_dependency("rspec-rails")
s.add_development_dependency("sinatra")

s.authors = ["Airbrake"]
s.email = %q{support@airbrake.io}
Expand Down

0 comments on commit 73edcf8

Please sign in to comment.