Skip to content

Commit

Permalink
Rails 6.1 Support (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
jturkel authored Dec 17, 2020
1 parent ba56d0f commit b72f966
Show file tree
Hide file tree
Showing 11 changed files with 99 additions and 19 deletions.
72 changes: 72 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
version: 2.1
jobs:
lint:
docker:
- image: salsify/ruby_ci:2.5.8
working_directory: ~/delayed_job_groups
steps:
- checkout
- restore_cache:
keys:
- v1-gems-ruby-2.5.8-{{ checksum "delayed_job_groups.gemspec" }}-{{ checksum "Gemfile" }}
- v1-gems-ruby-2.5.8-
- run:
name: Install Gems
command: |
if ! bundle check --path=vendor/bundle; then
bundle install --path=vendor/bundle --jobs=4 --retry=3
bundle clean
fi
- save_cache:
key: v1-gems-ruby-2.5.8-{{ checksum "delayed_job_groups.gemspec" }}-{{ checksum "Gemfile" }}
paths:
- "vendor/bundle"
- "gemfiles/vendor/bundle"
- run:
name: Run Rubocop
command: bundle exec rubocop
test:
parameters:
gemfile:
type: string
docker:
- image: salsify/ruby_ci:2.5.8
environment:
CIRCLE_TEST_REPORTS: "test-results"
BUNDLE_GEMFILE: << parameters.gemfile >>
working_directory: ~/delayed_job_groups
steps:
- checkout
- restore_cache:
keys:
- v1-gems-ruby-2.5.8-{{ checksum "delayed_job_groups.gemspec" }}-{{ checksum "<< parameters.gemfile >>" }}
- v1-gems-ruby-2.5.8-
- run:
name: Install Gems
command: |
if ! bundle check --path=vendor/bundle; then
bundle install --path=vendor/bundle --jobs=4 --retry=3
bundle clean
fi
- save_cache:
key: v1-gems-ruby-2.5.8-{{ checksum "delayed_job_groups.gemspec" }}-{{ checksum "<< parameters.gemfile >>" }}
paths:
- "vendor/bundle"
- "gemfiles/vendor/bundle"
- run:
name: Run Tests
command: |
bundle exec rspec --format RspecJunitFormatter --out $CIRCLE_TEST_REPORTS/rspec/junit.xml --format progress spec
- store_test_results:
path: "test-results"
workflows:
build:
jobs:
- lint
- test:
matrix:
parameters:
gemfile:
- "gemfiles/rails_5.2.gemfile"
- "gemfiles/rails_6.0.gemfile"
- "gemfiles/rails_6.1.gemfile"
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ inherit_gem:

AllCops:
TargetRubyVersion: 2.5
Exclude:
- 'vendor/**/*'
- 'gemfiles/vendor/**/*'

Style/FrozenStringLiteralComment:
Enabled: true
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ appraise 'rails-6.0' do
gem 'activerecord', '6.0.3'
gem 'activesupport', '6.0.3'
end

appraise 'rails-6.1' do
gem 'activerecord', '6.1.0'
gem 'activesupport', '6.1.0'
end
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

### 0.6.0
* A support for Rails 6.1.

### 0.5.0
* Drop support for Ruby 2.3 and 2.4.
* Drop support for Rails < 5.2.
Expand Down
3 changes: 2 additions & 1 deletion delayed_job_groups.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ Gem::Specification.new do |spec|
spec.post_install_message = 'See https://github.com/salsify/delayed_job_groups_plugin#installation for upgrade/installation notes.'

spec.add_development_dependency 'appraisal'
spec.add_dependency 'activerecord', '>= 5.2', '< 6.1'
spec.add_dependency 'activerecord', '>= 5.2', '< 7'
spec.add_development_dependency 'coveralls_reborn', '>= 0.18.0'
spec.add_development_dependency 'database_cleaner', '>= 1.2'
spec.add_development_dependency 'mime-types'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rspec', '~> 3'
spec.add_development_dependency 'rspec-its'
spec.add_development_dependency 'rspec_junit_formatter'
spec.add_development_dependency 'salsify_rubocop', '0.52.1.1'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'sqlite3'
Expand Down
4 changes: 2 additions & 2 deletions gemfiles/rails_5.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source "https://rubygems.org"

gem "sqlite3", "~> 1.3.6"
gem "activerecord", "5.2.1 "
gem "activesupport", "5.2.1 "
gem "activerecord", "5.2.1"
gem "activesupport", "5.2.1"

gemspec path: "../"
8 changes: 8 additions & 0 deletions gemfiles/rails_6.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "6.1.0"
gem "activesupport", "6.1.0"

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

module Delayed
module JobGroups
VERSION = '0.5.0'
VERSION = '0.6.0'
end
end
4 changes: 2 additions & 2 deletions spec/delayed/job_groups/job_group_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@

context "when on failed jobs exist" do
before do
job.update_attributes!(failed_at: Time.now)
job.update!(failed_at: Time.now)
Delayed::JobGroups::JobGroup.check_for_completion(job_group.id)
end

Expand Down Expand Up @@ -229,7 +229,7 @@
let(:failure_cancels_group) { true }

before do
job_group.update_attributes!(failure_cancels_group: failure_cancels_group)
job_group.update!(failure_cancels_group: failure_cancels_group)
end

context "when failures should cancel the group" do
Expand Down
2 changes: 1 addition & 1 deletion spec/delayed/job_groups/plugin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@

context "with failure_cancels_group disabled" do

before { job_group.update_attributes!(failure_cancels_group: false) }
before { job_group.update!(failure_cancels_group: false) }

it "does not cancel the group" do
Delayed::Worker.max_attempts = 1
Expand Down

0 comments on commit b72f966

Please sign in to comment.