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

Run tests locally #736

Merged
merged 5 commits into from
Jun 14, 2024
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
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"
Loading