Enable Rails minitest plugin in our rake tasks

This commit is contained in:
Rafael Mendonça França 2024-05-23 16:16:37 +00:00
parent fd6c266266
commit 7ee34d9efb
No known key found for this signature in database
GPG Key ID: FC23B6D0F1EEE948
13 changed files with 25 additions and 1 deletions

@ -10,6 +10,8 @@ task default: :test
task :package task :package
ENV["RAILS_MINITEST_PLUGIN"] = "true"
Rake::TestTask.new do |t| Rake::TestTask.new do |t|
t.libs << "test" t.libs << "test"
t.test_files = FileList["#{__dir__}/test/**/*_test.rb"] t.test_files = FileList["#{__dir__}/test/**/*_test.rb"]

@ -6,6 +6,8 @@ require "rake/testtask"
task :package task :package
ENV["RAILS_MINITEST_PLUGIN"] = "true"
Rake::TestTask.new do |t| Rake::TestTask.new do |t|
t.libs << "test" t.libs << "test"
t.pattern = "test/**/*_test.rb" t.pattern = "test/**/*_test.rb"

@ -7,6 +7,8 @@ task default: [ :test ]
task :package task :package
ENV["RAILS_MINITEST_PLUGIN"] = "true"
# Run the unit tests # Run the unit tests
Rake::TestTask.new { |t| Rake::TestTask.new { |t|
t.libs << "test" t.libs << "test"

@ -9,6 +9,8 @@ task default: :test
task :package task :package
ENV["RAILS_MINITEST_PLUGIN"] = "true"
# Run the unit tests # Run the unit tests
Rake::TestTask.new do |t| Rake::TestTask.new do |t|
t.libs << "test" t.libs << "test"

@ -6,6 +6,8 @@ require "rake/testtask"
task :package task :package
ENV["RAILS_MINITEST_PLUGIN"] = "true"
Rake::TestTask.new do |t| Rake::TestTask.new do |t|
t.libs << "test" t.libs << "test"
t.test_files = FileList["test/**/*_test.rb"].exclude("test/system/**/*", "test/dummy/**/*") t.test_files = FileList["test/**/*_test.rb"].exclude("test/system/**/*", "test/dummy/**/*")

@ -10,6 +10,8 @@ task default: :test
task :package task :package
ENV["RAILS_MINITEST_PLUGIN"] = "true"
# Run the unit tests # Run the unit tests
desc "Run all unit tests" desc "Run all unit tests"

@ -10,6 +10,8 @@ task test: "test:default"
task :package task :package
ENV["RAILS_MINITEST_PLUGIN"] = "true"
namespace :test do namespace :test do
desc "Run all adapter tests" desc "Run all adapter tests"
task :default do task :default do

@ -6,6 +6,8 @@ task default: :test
task :package task :package
ENV["RAILS_MINITEST_PLUGIN"] = "true"
Rake::TestTask.new do |t| Rake::TestTask.new do |t|
t.libs << "test" t.libs << "test"
t.test_files = FileList["#{__dir__}/test/cases/**/*_test.rb"] t.test_files = FileList["#{__dir__}/test/cases/**/*_test.rb"]

@ -23,6 +23,8 @@ task default: :test
task :package task :package
ENV["RAILS_MINITEST_PLUGIN"] = "true"
desc "Run mysql2, trilogy, sqlite, and postgresql tests" desc "Run mysql2, trilogy, sqlite, and postgresql tests"
task :test do task :test do
tasks = defined?(JRUBY_VERSION) ? tasks = defined?(JRUBY_VERSION) ?

@ -4,6 +4,8 @@ require "bundler/setup"
require "bundler/gem_tasks" require "bundler/gem_tasks"
require "rake/testtask" require "rake/testtask"
ENV["RAILS_MINITEST_PLUGIN"] = "true"
Rake::TestTask.new do |t| Rake::TestTask.new do |t|
t.libs << "app/controllers" t.libs << "app/controllers"
t.libs << "test" t.libs << "test"

@ -6,6 +6,8 @@ task default: :test
task :package task :package
ENV["RAILS_MINITEST_PLUGIN"] = "true"
Rake::TestTask.new do |t| Rake::TestTask.new do |t|
t.pattern = "test/**/*_test.rb" t.pattern = "test/**/*_test.rb"
t.warning = true t.warning = true

@ -7,6 +7,8 @@ task default: :test
task :package task :package
ENV["RAILS_MINITEST_PLUGIN"] = "true"
desc "Run all unit tests" desc "Run all unit tests"
task test: "test:isolated" task test: "test:isolated"

@ -110,7 +110,7 @@ def self.plugin_rails_options(opts, options)
# minitest-reporters, maxitest, and others. # minitest-reporters, maxitest, and others.
def self.plugin_rails_init(options) def self.plugin_rails_init(options)
# Don't mess with Minitest unless RAILS_ENV is set # Don't mess with Minitest unless RAILS_ENV is set
return unless ENV["RAILS_ENV"] return unless ENV["RAILS_ENV"] || ENV["RAILS_MINITEST_PLUGIN"]
unless options[:full_backtrace] unless options[:full_backtrace]
# Plugin can run without Rails loaded, check before filtering. # Plugin can run without Rails loaded, check before filtering.