Skip to content

Commit

Permalink
Merge 5dca3c7 into ca528ff
Browse files Browse the repository at this point in the history
  • Loading branch information
jturkel committed Nov 5, 2018
2 parents ca528ff + 5dca3c7 commit 83c6a21
Show file tree
Hide file tree
Showing 14 changed files with 102 additions and 71 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -18,3 +18,4 @@ spec/reports
test/tmp
test/version_tmp
tmp
*.gemfile.lock
39 changes: 8 additions & 31 deletions .travis.yml
@@ -1,34 +1,11 @@
language: ruby
sudo: false
env:
global:
- JRUBY_OPTS="$JRUBY_OPTS --debug"
matrix:
- RAILS_VERSION="~> 3.2.22.5"
- RAILS_VERSION="~> 4.0.13"
- RAILS_VERSION="~> 4.1.16"
- RAILS_VERSION="~> 4.2.9"
- RAILS_VERSION="~> 5.0.6"
- RAILS_VERSION="~> 5.1.3"
gemfile:
- gemfiles/rails_4.2.gemfile
- gemfiles/rails_5.0.gemfile
- gemfiles/rails_5.1.gemfile
- gemfiles/rails_5.2.gemfile
rvm:
- 2.1.10
- 2.2.8
- 2.3.5
- 2.4.2
- jruby-9.1.13.0
matrix:
exclude:
- rvm: 2.1.10
env: RAILS_VERSION="~> 5.0.6"
- rvm: 2.4.2
env: RAILS_VERSION="~> 3.2.22.5"
- rvm: 2.4.2
env: RAILS_VERSION="~> 4.0.13"
- rvm: 2.4.2
env: RAILS_VERSION="~> 4.1.16"
- rvm: jruby-9.1.13.0
env: RAILS_VERSION="~> 5.0.6"
- rvm: 2.1.10
env: RAILS_VERSION="~> 5.1.3"
- rvm: jruby-9.1.13.0
env: RAILS_VERSION="~> 5.1.3"
- 2.3.8
- 2.4.5
- 2.5.3
21 changes: 21 additions & 0 deletions Appraisals
@@ -0,0 +1,21 @@
# frozen_string_literal: true

appraise 'rails-4.2' do
gem 'activerecord', '4.2.10'
gem 'activesupport', '4.2.10'
end

appraise 'rails-5.0' do
gem 'activerecord', '5.0.7'
gem 'activesupport', '5.0.7'
end

appraise 'rails-5.1' do
gem 'activerecord', '5.1.6'
gem 'activesupport', '5.1.6'
end

appraise 'rails-5.2' do
gem 'activerecord', '5.2.1 '
gem 'activesupport', '5.2.1 '
end
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,11 @@
# Changelog

### 0.4.0
* Drop support for Ruby 2.0, 2.1 and 2.2.
* Add support for Ruby 2.5.
* Drop support for Rails < 4.2.
* Add support for Rails 5.2

### 0.3.0
* Drop support for Ruby 1.9 and 2.0.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -107,8 +107,8 @@ job_group = Delayed::JobGroups::JobGroup.create!(failure_cancels_group: false)
## Supported Platforms

* Only the Delayed Job Active Record backend is supported.
* Tested with Rails 3.2 and 4.0.
* Tested with MRI 1.9.3, 2.0.0, 2.1.0 and JRuby in 1.9 mode.
* Tested with Rails 4.2 through 5.2.
* Tested with MRI 2.3 through 2.5.

## Contributing

Expand Down
26 changes: 10 additions & 16 deletions delayed_job_groups.gemspec
Expand Up @@ -17,28 +17,22 @@ Gem::Specification.new do |spec|
spec.test_files = Dir.glob('spec/**/*')
spec.require_paths = ['lib']

spec.required_ruby_version = '>= 2.1'
spec.required_ruby_version = '>= 2.3'

spec.add_dependency 'delayed_job', '>= 4.1'
spec.add_dependency 'delayed_job_active_record', '>= 0.4'
spec.add_dependency 'delayed_job_active_record', '>= 4.1'

spec.post_install_message = 'See https://github.com/salsify/delayed_job_groups_plugin#installation for upgrade/installation notes.'

spec.add_development_dependency 'activerecord', ENV.fetch('RAILS_VERSION', ['>= 3.2', '< 5.2'])
spec.add_development_dependency 'appraisal'
spec.add_dependency 'activerecord', '>= 4.2', '< 5.3'
spec.add_development_dependency 'coveralls'
spec.add_development_dependency 'database_cleaner', '>= 1.2'
# rspec < 3.5 requires rake < 11.0
spec.add_development_dependency 'rake', '< 11.0'
spec.add_development_dependency 'rspec', '>= 2.14', '< 2.99'
spec.add_development_dependency 'simplecov', '~> 0.7.1'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rspec', '~> 3'
spec.add_development_dependency 'rspec-its'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'timecop'
spec.add_development_dependency 'mime-types', '~> 2'

if RUBY_PLATFORM == 'java'
spec.add_development_dependency 'jdbc-sqlite3'
spec.add_development_dependency 'activerecord-jdbcsqlite3-adapter'
else
spec.add_development_dependency 'sqlite3'
end

spec.add_development_dependency 'mime-types'
spec.add_development_dependency 'sqlite3'
end
8 changes: 8 additions & 0 deletions gemfiles/rails_4.2.gemfile
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "4.2.10"
gem "activesupport", "4.2.10"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/rails_5.0.gemfile
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "5.0.7"
gem "activesupport", "5.0.7"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/rails_5.1.gemfile
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "5.1.6"
gem "activesupport", "5.1.6"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/rails_5.2.gemfile
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "5.2.1 "
gem "activesupport", "5.2.1 "

gemspec path: "../"
2 changes: 1 addition & 1 deletion lib/delayed/job_groups/version.rb
Expand Up @@ -2,6 +2,6 @@

module Delayed
module JobGroups
VERSION = '0.3.0'
VERSION = '0.4.0'
end
end
6 changes: 3 additions & 3 deletions spec/delayed/job_groups/job_group_spec.rb
Expand Up @@ -169,7 +169,7 @@
job_group.unblock
end

its(:blocked?) { should be_false }
its(:blocked?) { should be(false) }
end

context "when the JobGroup is blocked" do
Expand All @@ -184,7 +184,7 @@
Timecop.freeze(unblock_time) { job_group.unblock }
end

its(:blocked?) { should be_false }
its(:blocked?) { should be(false) }

it "sets the job's run_at to the unblocked time" do
job.reload.run_at.should eq unblock_time
Expand All @@ -199,7 +199,7 @@
job_group.unblock
end

its(:blocked?) { should be_false }
its(:blocked?) { should be(false) }
it_behaves_like "the job group was completed"
end
end
Expand Down
34 changes: 17 additions & 17 deletions spec/delayed/job_groups/plugin_spec.rb
Expand Up @@ -29,19 +29,19 @@

# Run our first job
Delayed::Worker.new.work_off(1)
CompletionJob.invoked.should be_false
CompletionJob.invoked.should be(false)
job_group_count.should eq 1
queued_job_count.should eq 1

# Run our second job which should enqueue the completion job
Delayed::Worker.new.work_off(1)
CompletionJob.invoked.should be_false
CompletionJob.invoked.should be(false)
job_group_count.should eq 0
queued_job_count.should eq 1

# Now we should run the completion job
Delayed::Worker.new.work_off(1)
CompletionJob.invoked.should be_true
CompletionJob.invoked.should be(true)
queued_job_count.should eq 0
end

Expand All @@ -53,13 +53,13 @@

# Run our first job
Delayed::Worker.new.work_off(1)
CompletionJob.invoked.should be_false
CompletionJob.invoked.should be(false)
job_group_count.should eq 1
queued_job_count.should eq 1

# Run our second job
Delayed::Worker.new.work_off(1)
CompletionJob.invoked.should be_false
CompletionJob.invoked.should be(false)
job_group_count.should eq 1
queued_job_count.should eq 0

Expand All @@ -70,7 +70,7 @@

# Now we should run the completion job
Delayed::Worker.new.work_off(1)
CompletionJob.invoked.should be_true
CompletionJob.invoked.should be(true)
queued_job_count.should eq 0
end

Expand All @@ -88,7 +88,7 @@

# Run the job which should fail and cancel the JobGroup
Delayed::Worker.new.work_off(1)
CompletionJob.invoked.should be_false
CompletionJob.invoked.should be(false)
failed_job_count.should eq 1
queued_job_count.should eq 0
job_group_count.should eq 0
Expand All @@ -110,7 +110,7 @@

# Run the job which should fail don't cancel the JobGroup
Delayed::Worker.new.work_off(1)
CancellationJob.invoked.should be_false
CancellationJob.invoked.should be(false)
failed_job_count.should eq 1
queued_job_count.should eq 1
job_group_count.should eq 1
Expand Down Expand Up @@ -148,19 +148,19 @@

# Run our first job
Delayed::Worker.new.work_off(1)
CompletionJob.invoked.should be_false
CompletionJob.invoked.should be(false)
job_group_count.should eq 1
Delayed::Job.count.should eq 1

# Run our second job which should enqueue the completion job
Delayed::Worker.new.work_off(1)
CompletionJob.invoked.should be_false
CompletionJob.invoked.should be(false)
job_group_count.should eq 0
Delayed::Job.count.should eq 1

# Now we should run the completion job
Delayed::Worker.new.work_off(1)
CompletionJob.invoked.should be_true
CompletionJob.invoked.should be(true)
Delayed::Job.count.should eq 0
end

Expand All @@ -181,17 +181,17 @@

# Run the job which should fail and cancel the JobGroup
Delayed::Worker.new.work_off(1)
CompletionJob.invoked.should be_false
CancellationJob.invoked.should be_false
CompletionJob.invoked.should be(false)
CancellationJob.invoked.should be(false)
failed_job_count.should eq 1

queued_job_count.should eq 1
job_group_count.should eq 0

# Now we should run the cancellation job
Delayed::Worker.new.work_off(1)
CompletionJob.invoked.should be_false
CancellationJob.invoked.should be_true
CompletionJob.invoked.should be(false)
CancellationJob.invoked.should be(true)
queued_job_count.should eq 0
end

Expand All @@ -203,11 +203,11 @@

#cancellation job should be queued
queued_job_count.should eq 1
CancellationJob.invoked.should be_false
CancellationJob.invoked.should be(false)

# Run the cancellation job
Delayed::Worker.new.work_off(1)
CancellationJob.invoked.should be_true
CancellationJob.invoked.should be(true)
queued_job_count.should eq 0
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Expand Up @@ -11,6 +11,7 @@
add_filter 'spec'
end

require 'rspec/its'
require 'database_cleaner'
require 'delayed_job_groups_plugin'
require 'yaml'
Expand All @@ -35,7 +36,6 @@
require 'db/schema'

RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true
config.order = 'random'

config.before(:suite) do
Expand Down

0 comments on commit 83c6a21

Please sign in to comment.