1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Remove coveralls, use simplecov, improve coverage

This commit is contained in:
Mike Perham 2015-07-10 12:35:02 -07:00
parent 0b7941cafd
commit 9f772406c4
6 changed files with 38 additions and 10 deletions

View file

@ -1,6 +1,8 @@
source 'https://rubygems.org' source 'https://rubygems.org'
gemspec gemspec
gem 'simplecov'
platforms :rbx do platforms :rbx do
gem 'rubysl', '~> 2.0' # if using anything in the ruby standard library gem 'rubysl', '~> 2.0' # if using anything in the ruby standard library
gem 'psych' # if using yaml gem 'psych' # if using yaml

View file

@ -4,7 +4,6 @@ Sidekiq
[![Gem Version](https://badge.fury.io/rb/sidekiq.svg)](https://rubygems.org/gems/sidekiq) [![Gem Version](https://badge.fury.io/rb/sidekiq.svg)](https://rubygems.org/gems/sidekiq)
[![Code Climate](https://codeclimate.com/github/mperham/sidekiq.svg)](https://codeclimate.com/github/mperham/sidekiq) [![Code Climate](https://codeclimate.com/github/mperham/sidekiq.svg)](https://codeclimate.com/github/mperham/sidekiq)
[![Build Status](https://travis-ci.org/mperham/sidekiq.svg)](https://travis-ci.org/mperham/sidekiq) [![Build Status](https://travis-ci.org/mperham/sidekiq.svg)](https://travis-ci.org/mperham/sidekiq)
[![Coverage Status](https://coveralls.io/repos/mperham/sidekiq/badge.svg?branch=master)](https://coveralls.io/r/mperham/sidekiq)
[![Gitter Chat](https://badges.gitter.im/mperham/sidekiq.svg)](https://gitter.im/mperham/sidekiq) [![Gitter Chat](https://badges.gitter.im/mperham/sidekiq.svg)](https://gitter.im/mperham/sidekiq)

View file

@ -23,5 +23,4 @@ Gem::Specification.new do |gem|
gem.add_development_dependency 'minitest', '~> 5.3.3' gem.add_development_dependency 'minitest', '~> 5.3.3'
gem.add_development_dependency 'rake' gem.add_development_dependency 'rake'
gem.add_development_dependency 'rails', '~> 4.1.1' gem.add_development_dependency 'rails', '~> 4.1.1'
gem.add_development_dependency 'coveralls'
end end

View file

@ -1,19 +1,13 @@
$CELLULOID_DEBUG = false $CELLULOID_DEBUG = false
$TESTING = true $TESTING = true
require 'coveralls' if ENV["COVERAGE"]
Coveralls.wear! do
add_filter "/test/"
add_filter "/myapp/"
end
ENV['RACK_ENV'] = ENV['RAILS_ENV'] = 'test'
if ENV.has_key?("SIMPLECOV")
require 'simplecov' require 'simplecov'
SimpleCov.start do SimpleCov.start do
add_filter "/test/" add_filter "/test/"
add_filter "/myapp/" add_filter "/myapp/"
end end
end end
ENV['RACK_ENV'] = ENV['RAILS_ENV'] = 'test'
begin begin
require 'pry-byebug' require 'pry-byebug'

View file

@ -362,4 +362,28 @@ class TestCli < Sidekiq::Test
end end
end end
describe 'misc' do
it 'handles interrupts' do
cli = Sidekiq::CLI.new
assert_raises Interrupt do
cli.handle_signal('INT')
end
assert_raises Interrupt do
cli.handle_signal('TERM')
end
cli.handle_signal('USR2')
cli.handle_signal('TTIN')
end
it 'can fire events' do
count = 0
Sidekiq.options[:lifecycle_events][:startup] = [proc {
count += 1
}]
cli = Sidekiq::CLI.new
cli.fire_event(:startup)
assert_equal 1, count
end
end
end end

View file

@ -66,4 +66,14 @@ class TestSidekiq < Sidekiq::Test
assert_equal 'cat', Sidekiq.default_worker_options['queue'] assert_equal 'cat', Sidekiq.default_worker_options['queue']
end end
end end
describe 'error handling' do
it 'deals with user-specified error handlers which raise errors' do
Sidekiq.error_handlers << proc {|x, hash|
raise 'boom'
}
cli = Sidekiq::CLI.new
cli.handle_exception(RuntimeError.new("hello"))
end
end
end end