Skip to content

Commit

Permalink
Run tests locally (#736)
Browse files Browse the repository at this point in the history
* WIP

* Rebase on another branch

* Changed in CI
Please review the changes in the files in this commit
carefully, as they were automatically generated during CI.
Run `git pull` to bring the changes into your local branch.
Then, if you do not want the changes, run `git revert HEAD`.

* Update gemfiles for gems not in Ruby 3.4

---------

Co-authored-by: github-actions <[email protected]>
  • Loading branch information
lcreid and github-actions authored Jun 14, 2024
1 parent bd4b153 commit 261bea6
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .yarnrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# yarn lockfile v1


lastUpdateCheck 1709415989700
lastUpdateCheck 1718162593302
23 changes: 23 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,26 @@ desc 'Run RuboCop checks'
RuboCop::RakeTask.new(:rubocop)

task default: %i[test rubocop:autocorrect]

namespace :test do
desc "Run tests for all supported Rails versions, with current Ruby version"
task :all do
original_directory = Dir.pwd
original_gemfile = ENV["BUNDLE_GEMFILE"]
gemfiles = Dir.glob("gemfiles/*.gemfile").reject { |f| File.basename(f) == "common.gemfile" }
gemfiles.each do |f|
ENV["BUNDLE_GEMFILE"] = f
system("bundle check") || system("bundle install")
system("bundle exec rake test")
end

Dir.chdir("demo")
ENV.delete("BUNDLE_GEMFILE")
system("bundle check") || system("bundle install")
system("bundle exec rake test:all")

ensure
original_gemfile.nil? ? ENV.delete("BUNDLE_GEMFILE") : ENV["BUNDLE_GEMFILE"] = original_gemfile
Dir.chdir(original_directory)
end
end
2 changes: 2 additions & 0 deletions gemfiles/6.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ eval File.read(gems), binding, gems # rubocop: disable Security/Eval
gem "bigdecimal" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0")
gem "drb" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0")
gem "mutex_m" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0")
gem "base64" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0")
gem "logger" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0")
gem "rails", "~> 6.1.0"
gem "sqlite3", "~> 1.4"
2 changes: 2 additions & 0 deletions gemfiles/7.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ eval File.read(gems), binding, gems # rubocop: disable Security/Eval
gem "bigdecimal" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0")
gem "drb" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0")
gem "mutex_m" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0")
gem "base64" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0")
gem "logger" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0")
gem "rails", "~> 7.0.2"
gem "sqlite3", "~> 1.4"
gem "sprockets-rails", require: "sprockets/railtie"

0 comments on commit 261bea6

Please sign in to comment.