ENV['RAILS_ENV'] ||= 'test' require_relative '../config/environment' # must load BEFORE rails/test_help require_relative './support/sqlite_test_db_loader.rb' require 'rails/test_help' require "minitest/rails" # This assumes you're sharing config between unit/integration module TestSetup extend ActiveSupport::Concern included do # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. fixtures :all # Use Jest-like CI flag parallelize(workers: ENV['CI'] ? 1 : :number_of_processors, with: :processes) # Make sure that you reload the sqlite when starting processes parallelize_setup do # slightly more efficient than a direct call to establish_connection ActiveRecord::Migration.check_pending! end end end class ActiveSupport::TestCase include TestSetup end class ActionDispatch::IntegrationTest include TestSetup end