Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test suite & appraisal setup #29

Merged
merged 1 commit into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@ gemspec

gem "gem-release"
gem "simplecov_json_formatter"

# FIXME: waiting for appraisal to support Ruby 3.2
# https://github.com/thoughtbot/appraisal/issues/199
gem "appraisal", github: "thoughtbot/appraisal"
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,16 +403,16 @@ bundle exec rubocop
bundle exec standardrb
```

All of them can be run with:

To run RSpec against various version of Rails dependencies:
```bash
bundle exec rake
bundle exec appraisal install
bundle exec appraisal rspec
```

To run test suite against various version of Rails dependencies:
All of them can be run with:

```bash
bundle exec appraisal install
bundle exec appraisal
bundle exec rake
```

## License & credits
Expand Down
25 changes: 18 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
# frozen_string_literal: true

require "bundler/gem_tasks"
require "appraisal"
require "rspec/core/rake_task"
require "rubocop/rake_task"
require "standard/rake"

RSpec::Core::RakeTask.new(:spec)
RuboCop::RakeTask.new

desc "Run the full CI"
task :default do
Rake::Task["spec"].invoke
Rake::Task["rubocop"].invoke
if ENV["APPRAISAL_INITIALIZED"]
Rake::Task["spec"].invoke
else
# FYI: Standard & appraisal requires each a spawn process.

# FYI: Standard requires a spawn process.
# Otherwise it may be tainted by the rubocop task and
# report offenses from other plugins putted in .rubocop_todo.yml
# https://github.com/testdouble/standard/issues/480
fail unless system "bundle exec rake standard"
# Additional tasks won't run after appraisal because of
# something to do with the exit code.
# https://github.com/thoughtbot/appraisal/issues/144

# Otherwise it may be tainted by the rubocop task and
# report offenses from other plugins putted in .rubocop_todo.yml
# https://github.com/testdouble/standard/issues/480

fail unless system "bundle exec appraisal rspec"
fail unless system "bundle exec rubocop"
fail unless system "bundle exec rake standard"
end
end
2 changes: 1 addition & 1 deletion activejob-status.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ Gem::Specification.new do |s|
s.add_development_dependency "rubocop-rspec"
s.add_development_dependency "rubocop-performance"
s.add_development_dependency "simplecov"
s.add_development_dependency "standard"
s.add_development_dependency "standard", ">= 1.0"
s.add_development_dependency "timecop"
end