diff --git a/.mdstyle.rb b/.mdstyle.rb index 62693986f..7d5cf578a 100644 --- a/.mdstyle.rb +++ b/.mdstyle.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md all rule 'MD007', indent: 4 # Unordered list indentation diff --git a/.rubocop.yml b/.rubocop.yml index dd330ade7..207cdd168 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -32,7 +32,7 @@ Gemspec/DevelopmentDependencies: Enabled: false Layout/EmptyLineAfterMagicComment: - Enabled: false + Enabled: true Layout/HashAlignment: Enabled: false diff --git a/.yard_support.rb b/.yard_support.rb index 69d2f5e46..c92350a7c 100644 --- a/.yard_support.rb +++ b/.yard_support.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'kramdown' require 'kramdown-parser-gfm' diff --git a/Appraisals b/Appraisals index 08e77449f..5767d2323 100644 --- a/Appraisals +++ b/Appraisals @@ -1,4 +1,5 @@ # frozen_string_literal: true + ruby_27_or_higher = Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7') ruby_31_or_higher = Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1') jruby = RUBY_PLATFORM.include?('java') diff --git a/Gemfile b/Gemfile index 24531dc46..46dd8c07c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,5 @@ # frozen_string_literal: true + source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } diff --git a/Rakefile b/Rakefile index 19fc00a9d..41b2c311f 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,5 @@ # frozen_string_literal: true + begin require 'bundler/setup' rescue LoadError diff --git a/app/controllers/good_job/application_controller.rb b/app/controllers/good_job/application_controller.rb index fc5a36ed1..ee146418a 100644 --- a/app/controllers/good_job/application_controller.rb +++ b/app/controllers/good_job/application_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob class ApplicationController < ActionController::Base protect_from_forgery with: :exception diff --git a/app/controllers/good_job/batches_controller.rb b/app/controllers/good_job/batches_controller.rb index 7edde8fbc..b9e294dc7 100644 --- a/app/controllers/good_job/batches_controller.rb +++ b/app/controllers/good_job/batches_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob class BatchesController < GoodJob::ApplicationController def index diff --git a/app/controllers/good_job/cron_entries_controller.rb b/app/controllers/good_job/cron_entries_controller.rb index ed408cd39..829403cbd 100644 --- a/app/controllers/good_job/cron_entries_controller.rb +++ b/app/controllers/good_job/cron_entries_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob class CronEntriesController < GoodJob::ApplicationController before_action :check_settings_migration!, only: [:enable, :disable] diff --git a/app/controllers/good_job/frontends_controller.rb b/app/controllers/good_job/frontends_controller.rb index dc1eecabc..14a79ffba 100644 --- a/app/controllers/good_job/frontends_controller.rb +++ b/app/controllers/good_job/frontends_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob class FrontendsController < ActionController::Base # rubocop:disable Rails/ApplicationController skip_after_action :verify_same_origin_request, raise: false diff --git a/app/controllers/good_job/jobs_controller.rb b/app/controllers/good_job/jobs_controller.rb index 0de3010b8..da1c6a8b6 100644 --- a/app/controllers/good_job/jobs_controller.rb +++ b/app/controllers/good_job/jobs_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob class JobsController < GoodJob::ApplicationController DISCARD_MESSAGE = "Discarded through dashboard" diff --git a/app/controllers/good_job/processes_controller.rb b/app/controllers/good_job/processes_controller.rb index 16043ca95..9bc77280b 100644 --- a/app/controllers/good_job/processes_controller.rb +++ b/app/controllers/good_job/processes_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob class ProcessesController < GoodJob::ApplicationController def index diff --git a/app/filters/good_job/base_filter.rb b/app/filters/good_job/base_filter.rb index 06b38ce84..881fd69ee 100644 --- a/app/filters/good_job/base_filter.rb +++ b/app/filters/good_job/base_filter.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob class BaseFilter DEFAULT_LIMIT = 25 diff --git a/app/filters/good_job/batches_filter.rb b/app/filters/good_job/batches_filter.rb index aceab2a7f..18c55f9a3 100644 --- a/app/filters/good_job/batches_filter.rb +++ b/app/filters/good_job/batches_filter.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob class BatchesFilter < BaseFilter def records diff --git a/app/filters/good_job/jobs_filter.rb b/app/filters/good_job/jobs_filter.rb index 788a861df..6a645edc4 100644 --- a/app/filters/good_job/jobs_filter.rb +++ b/app/filters/good_job/jobs_filter.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob class JobsFilter < BaseFilter def states diff --git a/app/helpers/good_job/application_helper.rb b/app/helpers/good_job/application_helper.rb index 8ecb59569..f88d8a587 100644 --- a/app/helpers/good_job/application_helper.rb +++ b/app/helpers/good_job/application_helper.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob module ApplicationHelper def format_duration(sec) diff --git a/app/models/concerns/good_job/error_events.rb b/app/models/concerns/good_job/error_events.rb index d3682274f..c6f79a0a9 100644 --- a/app/models/concerns/good_job/error_events.rb +++ b/app/models/concerns/good_job/error_events.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob # Shared methods for filtering Execution/Job records from the +good_jobs+ table. module ErrorEvents diff --git a/app/models/concerns/good_job/filterable.rb b/app/models/concerns/good_job/filterable.rb index ce5b95028..91f1eff4a 100644 --- a/app/models/concerns/good_job/filterable.rb +++ b/app/models/concerns/good_job/filterable.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob # Shared methods for filtering Execution/Job records from the +good_jobs+ table. module Filterable diff --git a/app/models/concerns/good_job/reportable.rb b/app/models/concerns/good_job/reportable.rb index 0925e8676..5217c2519 100644 --- a/app/models/concerns/good_job/reportable.rb +++ b/app/models/concerns/good_job/reportable.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob module Reportable # There are 3 buckets of non-overlapping statuses: diff --git a/app/models/good_job/base_record.rb b/app/models/good_job/base_record.rb index 19a33da2b..0379bd0f3 100644 --- a/app/models/good_job/base_record.rb +++ b/app/models/good_job/base_record.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob ACTIVE_RECORD_PARENT_CLASS = Object.const_get(GoodJob.active_record_parent_class) diff --git a/app/models/good_job/cron_entry.rb b/app/models/good_job/cron_entry.rb index 5f4de6281..ae3e4343c 100644 --- a/app/models/good_job/cron_entry.rb +++ b/app/models/good_job/cron_entry.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "concurrent/hash" require "concurrent/scheduled_task" require "fugit" diff --git a/app/models/good_job/execution.rb b/app/models/good_job/execution.rb index 9801867d1..dadc0b339 100644 --- a/app/models/good_job/execution.rb +++ b/app/models/good_job/execution.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob # ActiveRecord model that represents an +ActiveJob+ job. class Execution < BaseExecution diff --git a/app/models/good_job/execution_result.rb b/app/models/good_job/execution_result.rb index d97419302..14f8e3a60 100644 --- a/app/models/good_job/execution_result.rb +++ b/app/models/good_job/execution_result.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob # Stores the results of job execution class ExecutionResult diff --git a/app/models/good_job/job.rb b/app/models/good_job/job.rb index 66a9c8f12..fadf6eb37 100644 --- a/app/models/good_job/job.rb +++ b/app/models/good_job/job.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob # ActiveRecord model that represents an +ActiveJob+ job. # There is not a table in the database whose discrete rows represents "Jobs". diff --git a/app/models/good_job/lockable.rb b/app/models/good_job/lockable.rb index 6648cca3e..a14b05512 100644 --- a/app/models/good_job/lockable.rb +++ b/app/models/good_job/lockable.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob # # Adds Postgres advisory locking capabilities to an ActiveRecord record. diff --git a/app/models/good_job/process.rb b/app/models/good_job/process.rb index 68b4cabf7..50100f5ef 100644 --- a/app/models/good_job/process.rb +++ b/app/models/good_job/process.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'socket' module GoodJob # :nodoc: diff --git a/config/routes.rb b/config/routes.rb index ac265d5a4..b8a6956bf 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + GoodJob::Engine.routes.draw do root to: redirect(path: 'jobs') diff --git a/exe/good_job b/exe/good_job index ef6993101..8be5c1757 100755 --- a/exe/good_job +++ b/exe/good_job @@ -1,5 +1,6 @@ #!/usr/bin/env ruby # frozen_string_literal: true + require 'good_job/cli' GoodJob::CLI.within_exe = true diff --git a/good_job.gemspec b/good_job.gemspec index 6603c5b3e..c90e7ba0e 100644 --- a/good_job.gemspec +++ b/good_job.gemspec @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_paths = ["lib"] require_paths.each do |require_path| $LOAD_PATH.push File.expand_path(require_path, __dir__) diff --git a/lib/active_job/queue_adapters/good_job_adapter.rb b/lib/active_job/queue_adapters/good_job_adapter.rb index ef1568585..8c61f3675 100644 --- a/lib/active_job/queue_adapters/good_job_adapter.rb +++ b/lib/active_job/queue_adapters/good_job_adapter.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module ActiveJob # :nodoc: module QueueAdapters # :nodoc: # See {GoodJob::Adapter} for details. diff --git a/lib/generators/good_job/install_generator.rb b/lib/generators/good_job/install_generator.rb index 0dffd1411..10e70028d 100644 --- a/lib/generators/good_job/install_generator.rb +++ b/lib/generators/good_job/install_generator.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails/generators' require 'rails/generators/active_record' diff --git a/lib/generators/good_job/templates/install/migrations/create_good_jobs.rb.erb b/lib/generators/good_job/templates/install/migrations/create_good_jobs.rb.erb index 6e6484928..ac592c6c5 100644 --- a/lib/generators/good_job/templates/install/migrations/create_good_jobs.rb.erb +++ b/lib/generators/good_job/templates/install/migrations/create_good_jobs.rb.erb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class CreateGoodJobs < ActiveRecord::Migration<%= migration_version %> def change # Uncomment for Postgres v12 or earlier to enable gen_random_uuid() support diff --git a/lib/generators/good_job/templates/update/migrations/01_create_good_jobs.rb.erb b/lib/generators/good_job/templates/update/migrations/01_create_good_jobs.rb.erb index ea7891861..4c5447324 100644 --- a/lib/generators/good_job/templates/update/migrations/01_create_good_jobs.rb.erb +++ b/lib/generators/good_job/templates/update/migrations/01_create_good_jobs.rb.erb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class CreateGoodJobs < ActiveRecord::Migration<%= migration_version %> def change # Uncomment for Postgres v12 or earlier to enable gen_random_uuid() support diff --git a/lib/generators/good_job/templates/update/migrations/02_create_good_job_settings.rb.erb b/lib/generators/good_job/templates/update/migrations/02_create_good_job_settings.rb.erb index bb753f2bf..2988c42f1 100644 --- a/lib/generators/good_job/templates/update/migrations/02_create_good_job_settings.rb.erb +++ b/lib/generators/good_job/templates/update/migrations/02_create_good_job_settings.rb.erb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class CreateGoodJobSettings < ActiveRecord::Migration<%= migration_version %> def change reversible do |dir| diff --git a/lib/generators/good_job/templates/update/migrations/03_create_index_good_jobs_jobs_on_priority_created_at_when_unfinished.rb.erb b/lib/generators/good_job/templates/update/migrations/03_create_index_good_jobs_jobs_on_priority_created_at_when_unfinished.rb.erb index 998648467..31e7292ee 100644 --- a/lib/generators/good_job/templates/update/migrations/03_create_index_good_jobs_jobs_on_priority_created_at_when_unfinished.rb.erb +++ b/lib/generators/good_job/templates/update/migrations/03_create_index_good_jobs_jobs_on_priority_created_at_when_unfinished.rb.erb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class CreateIndexGoodJobsJobsOnPriorityCreatedAtWhenUnfinished < ActiveRecord::Migration<%= migration_version %> disable_ddl_transaction! diff --git a/lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb b/lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb index 1e361e50a..801573abe 100644 --- a/lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb +++ b/lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class CreateGoodJobBatches < ActiveRecord::Migration<%= migration_version %> def change reversible do |dir| diff --git a/lib/generators/good_job/templates/update/migrations/05_create_good_job_executions.rb.erb b/lib/generators/good_job/templates/update/migrations/05_create_good_job_executions.rb.erb index eb2fd1392..051d6f8f7 100644 --- a/lib/generators/good_job/templates/update/migrations/05_create_good_job_executions.rb.erb +++ b/lib/generators/good_job/templates/update/migrations/05_create_good_job_executions.rb.erb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class CreateGoodJobExecutions < ActiveRecord::Migration<%= migration_version %> def change reversible do |dir| diff --git a/lib/generators/good_job/templates/update/migrations/06_create_good_jobs_error_event.rb.erb b/lib/generators/good_job/templates/update/migrations/06_create_good_jobs_error_event.rb.erb index 3a493bae6..45bd61e53 100644 --- a/lib/generators/good_job/templates/update/migrations/06_create_good_jobs_error_event.rb.erb +++ b/lib/generators/good_job/templates/update/migrations/06_create_good_jobs_error_event.rb.erb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class CreateGoodJobsErrorEvent < ActiveRecord::Migration<%= migration_version %> def change reversible do |dir| diff --git a/lib/generators/good_job/update_generator.rb b/lib/generators/good_job/update_generator.rb index 85494e679..3fc7ba23d 100644 --- a/lib/generators/good_job/update_generator.rb +++ b/lib/generators/good_job/update_generator.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails/generators' require 'rails/generators/active_record' diff --git a/lib/good_job.rb b/lib/good_job.rb index f5153beb7..449583d40 100644 --- a/lib/good_job.rb +++ b/lib/good_job.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "active_job" require "active_job/queue_adapters" diff --git a/lib/good_job/active_job_extensions/batches.rb b/lib/good_job/active_job_extensions/batches.rb index 2351fff4e..f0fe20d9e 100644 --- a/lib/good_job/active_job_extensions/batches.rb +++ b/lib/good_job/active_job_extensions/batches.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob module ActiveJobExtensions module Batches diff --git a/lib/good_job/active_job_extensions/concurrency.rb b/lib/good_job/active_job_extensions/concurrency.rb index 89bd3466f..a25bb42ed 100644 --- a/lib/good_job/active_job_extensions/concurrency.rb +++ b/lib/good_job/active_job_extensions/concurrency.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob module ActiveJobExtensions module Concurrency diff --git a/lib/good_job/active_job_extensions/interrupt_errors.rb b/lib/good_job/active_job_extensions/interrupt_errors.rb index ccb20cd99..ee5f1faee 100644 --- a/lib/good_job/active_job_extensions/interrupt_errors.rb +++ b/lib/good_job/active_job_extensions/interrupt_errors.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob module ActiveJobExtensions module InterruptErrors diff --git a/lib/good_job/active_job_extensions/notify_options.rb b/lib/good_job/active_job_extensions/notify_options.rb index 4a22cb1f4..75af747e8 100644 --- a/lib/good_job/active_job_extensions/notify_options.rb +++ b/lib/good_job/active_job_extensions/notify_options.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob module ActiveJobExtensions # Allows configuring whether GoodJob should emit a NOTIFY event when a job is enqueued. diff --git a/lib/good_job/adapter.rb b/lib/good_job/adapter.rb index 185eb7227..1c436afa8 100644 --- a/lib/good_job/adapter.rb +++ b/lib/good_job/adapter.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob # # ActiveJob Adapter. diff --git a/lib/good_job/assignable_connection.rb b/lib/good_job/assignable_connection.rb index 1b4b84a49..fd8fb5257 100644 --- a/lib/good_job/assignable_connection.rb +++ b/lib/good_job/assignable_connection.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob # :nodoc: # Extends an ActiveRecord odel to override the connection and use # an explicit connection that has been removed from the pool. diff --git a/lib/good_job/bulk.rb b/lib/good_job/bulk.rb index ab40bcb25..34b2ed2a2 100644 --- a/lib/good_job/bulk.rb +++ b/lib/good_job/bulk.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'active_support/core_ext/module/attribute_accessors_per_thread' module GoodJob diff --git a/lib/good_job/capsule.rb b/lib/good_job/capsule.rb index 5b24597c4..3a954c634 100644 --- a/lib/good_job/capsule.rb +++ b/lib/good_job/capsule.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob # A GoodJob::Capsule contains the resources necessary to execute jobs, including # a {GoodJob::Scheduler}, {GoodJob::Poller}, {GoodJob::Notifier}, and {GoodJob::CronManager}. diff --git a/lib/good_job/cleanup_tracker.rb b/lib/good_job/cleanup_tracker.rb index 9822f4e41..6d5ff8fb8 100644 --- a/lib/good_job/cleanup_tracker.rb +++ b/lib/good_job/cleanup_tracker.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob # :nodoc: # Tracks thresholds for cleaning up old jobs. class CleanupTracker diff --git a/lib/good_job/cli.rb b/lib/good_job/cli.rb index 9599f6061..ed0adc62a 100644 --- a/lib/good_job/cli.rb +++ b/lib/good_job/cli.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'thor' module GoodJob diff --git a/lib/good_job/configuration.rb b/lib/good_job/configuration.rb index 69143f5b5..dc414fd61 100644 --- a/lib/good_job/configuration.rb +++ b/lib/good_job/configuration.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob # # +GoodJob::Configuration+ provides normalized configuration information to diff --git a/lib/good_job/cron_manager.rb b/lib/good_job/cron_manager.rb index 7588f9dec..8d88d09ba 100644 --- a/lib/good_job/cron_manager.rb +++ b/lib/good_job/cron_manager.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "concurrent/hash" require "concurrent/scheduled_task" require "fugit" diff --git a/lib/good_job/current_thread.rb b/lib/good_job/current_thread.rb index 8d7f3acea..3b9608365 100644 --- a/lib/good_job/current_thread.rb +++ b/lib/good_job/current_thread.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'active_support/core_ext/module/attribute_accessors_per_thread' module GoodJob diff --git a/lib/good_job/daemon.rb b/lib/good_job/daemon.rb index c6532de5f..eaa62c4a6 100644 --- a/lib/good_job/daemon.rb +++ b/lib/good_job/daemon.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob # # Manages daemonization of the current process. diff --git a/lib/good_job/engine.rb b/lib/good_job/engine.rb index 269a22786..f094011ec 100644 --- a/lib/good_job/engine.rb +++ b/lib/good_job/engine.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob # Ruby on Rails integration. class Engine < ::Rails::Engine diff --git a/lib/good_job/interrupt_error.rb b/lib/good_job/interrupt_error.rb index 61db1f911..8c11707bc 100644 --- a/lib/good_job/interrupt_error.rb +++ b/lib/good_job/interrupt_error.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob # Exception raised when a job is interrupted by a SIGKILL or power failure. class InterruptError < StandardError diff --git a/lib/good_job/job_performer.rb b/lib/good_job/job_performer.rb index a5d5d456d..ae7135333 100644 --- a/lib/good_job/job_performer.rb +++ b/lib/good_job/job_performer.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'concurrent/delay' module GoodJob diff --git a/lib/good_job/log_subscriber.rb b/lib/good_job/log_subscriber.rb index 7e199701a..a12b97595 100644 --- a/lib/good_job/log_subscriber.rb +++ b/lib/good_job/log_subscriber.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob # # Listens to GoodJob notifications and logs them. diff --git a/lib/good_job/metrics.rb b/lib/good_job/metrics.rb index add168ee3..9edd9f83e 100644 --- a/lib/good_job/metrics.rb +++ b/lib/good_job/metrics.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob # :nodoc: # Metrics for the scheduler. class Metrics diff --git a/lib/good_job/multi_scheduler.rb b/lib/good_job/multi_scheduler.rb index 62c905a99..6fc64393e 100644 --- a/lib/good_job/multi_scheduler.rb +++ b/lib/good_job/multi_scheduler.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob # Delegates the interface of a single {Scheduler} to multiple Schedulers. class MultiScheduler diff --git a/lib/good_job/notifier.rb b/lib/good_job/notifier.rb index c87bf5b68..05387d857 100644 --- a/lib/good_job/notifier.rb +++ b/lib/good_job/notifier.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'active_support/core_ext/module/attribute_accessors_per_thread' require 'concurrent/atomic/atomic_boolean' require "good_job/notifier/process_heartbeat" diff --git a/lib/good_job/poller.rb b/lib/good_job/poller.rb index d1e9b26ee..4a7ffb562 100644 --- a/lib/good_job/poller.rb +++ b/lib/good_job/poller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'concurrent/atomic/atomic_boolean' module GoodJob # :nodoc: diff --git a/lib/good_job/scheduler.rb b/lib/good_job/scheduler.rb index 57d62bd99..89d61faeb 100644 --- a/lib/good_job/scheduler.rb +++ b/lib/good_job/scheduler.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "concurrent/executor/thread_pool_executor" require "concurrent/executor/timer_set" require "concurrent/scheduled_task" diff --git a/lib/good_job/version.rb b/lib/good_job/version.rb index ab9d8c50a..8bf7d9bec 100644 --- a/lib/good_job/version.rb +++ b/lib/good_job/version.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module GoodJob # GoodJob gem version. VERSION = '3.15.14' diff --git a/spec/app/charts/good_job/scheduled_by_queue_chart_spec.rb b/spec/app/charts/good_job/scheduled_by_queue_chart_spec.rb index bc7a1b02b..9f44948f3 100644 --- a/spec/app/charts/good_job/scheduled_by_queue_chart_spec.rb +++ b/spec/app/charts/good_job/scheduled_by_queue_chart_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::ScheduledByQueueChart do diff --git a/spec/app/controllers/good_job/application_controller_spec.rb b/spec/app/controllers/good_job/application_controller_spec.rb index 9fabcde41..6ee4552fb 100644 --- a/spec/app/controllers/good_job/application_controller_spec.rb +++ b/spec/app/controllers/good_job/application_controller_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "rails_helper" RSpec.describe GoodJob::ApplicationController, type: :controller do diff --git a/spec/app/filters/good_job/jobs_filter_spec.rb b/spec/app/filters/good_job/jobs_filter_spec.rb index 1a961a6dd..9f90eb95a 100644 --- a/spec/app/filters/good_job/jobs_filter_spec.rb +++ b/spec/app/filters/good_job/jobs_filter_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::JobsFilter do diff --git a/spec/app/jobs/example_job_spec.rb b/spec/app/jobs/example_job_spec.rb index 327b531e4..1da18affb 100644 --- a/spec/app/jobs/example_job_spec.rb +++ b/spec/app/jobs/example_job_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' describe ExampleJob do diff --git a/spec/app/models/concerns/good_job/filterable_spec.rb b/spec/app/models/concerns/good_job/filterable_spec.rb index 966bcfa0f..df3a891b7 100644 --- a/spec/app/models/concerns/good_job/filterable_spec.rb +++ b/spec/app/models/concerns/good_job/filterable_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::Filterable do diff --git a/spec/app/models/good_job/batch_record_spec.rb b/spec/app/models/good_job/batch_record_spec.rb index 643e6fec0..b7192226e 100644 --- a/spec/app/models/good_job/batch_record_spec.rb +++ b/spec/app/models/good_job/batch_record_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' describe GoodJob::BatchRecord do diff --git a/spec/app/models/good_job/batch_spec.rb b/spec/app/models/good_job/batch_spec.rb index ea7bd4bd2..a5bca6a68 100644 --- a/spec/app/models/good_job/batch_spec.rb +++ b/spec/app/models/good_job/batch_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' describe GoodJob::Batch do diff --git a/spec/app/models/good_job/cron_entry_spec.rb b/spec/app/models/good_job/cron_entry_spec.rb index 8b5669ac0..63b08e758 100644 --- a/spec/app/models/good_job/cron_entry_spec.rb +++ b/spec/app/models/good_job/cron_entry_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' describe GoodJob::CronEntry do diff --git a/spec/app/models/good_job/execution_spec.rb b/spec/app/models/good_job/execution_spec.rb index 1ad42f075..dc1f72cc7 100644 --- a/spec/app/models/good_job/execution_spec.rb +++ b/spec/app/models/good_job/execution_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::Execution do diff --git a/spec/app/models/good_job/job_spec.rb b/spec/app/models/good_job/job_spec.rb index 75d37b596..1ed18dd3e 100644 --- a/spec/app/models/good_job/job_spec.rb +++ b/spec/app/models/good_job/job_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::Job do diff --git a/spec/app/models/good_job/lockable_spec.rb b/spec/app/models/good_job/lockable_spec.rb index cc39f1658..3f29e3c2f 100644 --- a/spec/app/models/good_job/lockable_spec.rb +++ b/spec/app/models/good_job/lockable_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::Lockable do diff --git a/spec/app/models/good_job/process_spec.rb b/spec/app/models/good_job/process_spec.rb index 5b1ce352c..fd27086ac 100644 --- a/spec/app/models/good_job/process_spec.rb +++ b/spec/app/models/good_job/process_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::Process do diff --git a/spec/app/models/good_job/setting_spec.rb b/spec/app/models/good_job/setting_spec.rb index 365f01cb6..ac92f6349 100644 --- a/spec/app/models/good_job/setting_spec.rb +++ b/spec/app/models/good_job/setting_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::Setting do diff --git a/spec/generators/good_job/install_generator_spec.rb b/spec/generators/good_job/install_generator_spec.rb index d1d2e7553..9b14243c1 100644 --- a/spec/generators/good_job/install_generator_spec.rb +++ b/spec/generators/good_job/install_generator_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' require 'generators/good_job/install_generator' diff --git a/spec/generators/good_job/update_generator_spec.rb b/spec/generators/good_job/update_generator_spec.rb index dec3a0970..e9874ed47 100644 --- a/spec/generators/good_job/update_generator_spec.rb +++ b/spec/generators/good_job/update_generator_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' require 'generators/good_job/update_generator' diff --git a/spec/integration/adapter_spec.rb b/spec/integration/adapter_spec.rb index b73cea143..cc1a6e635 100644 --- a/spec/integration/adapter_spec.rb +++ b/spec/integration/adapter_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe 'Adapter Integration' do diff --git a/spec/integration/batch_spec.rb b/spec/integration/batch_spec.rb index bb4396fc7..6b4aeabb1 100644 --- a/spec/integration/batch_spec.rb +++ b/spec/integration/batch_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe 'Batches' do diff --git a/spec/integration/complex_jobs_spec.rb b/spec/integration/complex_jobs_spec.rb index 66980c1ec..8cdc6a441 100644 --- a/spec/integration/complex_jobs_spec.rb +++ b/spec/integration/complex_jobs_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe 'Complex Jobs' do diff --git a/spec/integration/scheduler_spec.rb b/spec/integration/scheduler_spec.rb index da5a2bbc8..a46bdd4fa 100644 --- a/spec/integration/scheduler_spec.rb +++ b/spec/integration/scheduler_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe 'Schedule Integration' do diff --git a/spec/integration/server_spec.rb b/spec/integration/server_spec.rb index cd8966b65..438d25a1c 100644 --- a/spec/integration/server_spec.rb +++ b/spec/integration/server_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' require 'uri' require 'net/http' diff --git a/spec/lib/active_job/queue_adapters/good_job_adapter_spec.rb b/spec/lib/active_job/queue_adapters/good_job_adapter_spec.rb index 127aabc2f..a78cbe2e1 100644 --- a/spec/lib/active_job/queue_adapters/good_job_adapter_spec.rb +++ b/spec/lib/active_job/queue_adapters/good_job_adapter_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' describe ActiveJob::QueueAdapters::GoodJobAdapter do diff --git a/spec/lib/good_job/active_job_extensions/batches_spec.rb b/spec/lib/good_job/active_job_extensions/batches_spec.rb index 7f955e7ab..5cf6a0229 100644 --- a/spec/lib/good_job/active_job_extensions/batches_spec.rb +++ b/spec/lib/good_job/active_job_extensions/batches_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::ActiveJobExtensions::Batches do diff --git a/spec/lib/good_job/active_job_extensions/concurrency_spec.rb b/spec/lib/good_job/active_job_extensions/concurrency_spec.rb index f580bd147..f64dc3fdb 100644 --- a/spec/lib/good_job/active_job_extensions/concurrency_spec.rb +++ b/spec/lib/good_job/active_job_extensions/concurrency_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::ActiveJobExtensions::Concurrency do diff --git a/spec/lib/good_job/active_job_extensions/interrupt_errors_spec.rb b/spec/lib/good_job/active_job_extensions/interrupt_errors_spec.rb index 4c020b4fc..6401576f7 100644 --- a/spec/lib/good_job/active_job_extensions/interrupt_errors_spec.rb +++ b/spec/lib/good_job/active_job_extensions/interrupt_errors_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::ActiveJobExtensions::InterruptErrors do diff --git a/spec/lib/good_job/active_job_extensions/notify_options_spec.rb b/spec/lib/good_job/active_job_extensions/notify_options_spec.rb index 8847c3540..bebb5c528 100644 --- a/spec/lib/good_job/active_job_extensions/notify_options_spec.rb +++ b/spec/lib/good_job/active_job_extensions/notify_options_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::ActiveJobExtensions::NotifyOptions do diff --git a/spec/lib/good_job/adapter_spec.rb b/spec/lib/good_job/adapter_spec.rb index cca320e54..a25c23427 100644 --- a/spec/lib/good_job/adapter_spec.rb +++ b/spec/lib/good_job/adapter_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::Adapter do diff --git a/spec/lib/good_job/bulk_spec.rb b/spec/lib/good_job/bulk_spec.rb index 1c30c2050..09ef6bbb3 100644 --- a/spec/lib/good_job/bulk_spec.rb +++ b/spec/lib/good_job/bulk_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' describe GoodJob::Bulk do diff --git a/spec/lib/good_job/capsule_spec.rb b/spec/lib/good_job/capsule_spec.rb index f44ffe5e8..57db9045a 100644 --- a/spec/lib/good_job/capsule_spec.rb +++ b/spec/lib/good_job/capsule_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' describe GoodJob::Capsule do diff --git a/spec/lib/good_job/cleanup_tracker_spec.rb b/spec/lib/good_job/cleanup_tracker_spec.rb index 93ec5c737..fd8adab71 100644 --- a/spec/lib/good_job/cleanup_tracker_spec.rb +++ b/spec/lib/good_job/cleanup_tracker_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' describe GoodJob::CleanupTracker do diff --git a/spec/lib/good_job/cli_spec.rb b/spec/lib/good_job/cli_spec.rb index c85278919..18ce27d03 100644 --- a/spec/lib/good_job/cli_spec.rb +++ b/spec/lib/good_job/cli_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::CLI do diff --git a/spec/lib/good_job/configuration_spec.rb b/spec/lib/good_job/configuration_spec.rb index 81d3ad9ac..6e15ed45a 100644 --- a/spec/lib/good_job/configuration_spec.rb +++ b/spec/lib/good_job/configuration_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::Configuration do diff --git a/spec/lib/good_job/cron_manager_spec.rb b/spec/lib/good_job/cron_manager_spec.rb index c34b20fdb..9d53b8747 100644 --- a/spec/lib/good_job/cron_manager_spec.rb +++ b/spec/lib/good_job/cron_manager_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::CronManager do diff --git a/spec/lib/good_job/current_thread_spec.rb b/spec/lib/good_job/current_thread_spec.rb index 73d33f2cc..33982dd15 100644 --- a/spec/lib/good_job/current_thread_spec.rb +++ b/spec/lib/good_job/current_thread_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::CurrentThread do diff --git a/spec/lib/good_job/daemon_spec.rb b/spec/lib/good_job/daemon_spec.rb index 002b0f819..d9d6320b6 100644 --- a/spec/lib/good_job/daemon_spec.rb +++ b/spec/lib/good_job/daemon_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::Daemon, skip_if_java: true do diff --git a/spec/lib/good_job/engine_spec.rb b/spec/lib/good_job/engine_spec.rb index 22d2cac23..0ac12191c 100644 --- a/spec/lib/good_job/engine_spec.rb +++ b/spec/lib/good_job/engine_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::Engine do diff --git a/spec/lib/good_job/job_performer_spec.rb b/spec/lib/good_job/job_performer_spec.rb index f0fb9ce2b..3da61b4ab 100644 --- a/spec/lib/good_job/job_performer_spec.rb +++ b/spec/lib/good_job/job_performer_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::JobPerformer do diff --git a/spec/lib/good_job/log_subscriber_spec.rb b/spec/lib/good_job/log_subscriber_spec.rb index 49f220527..eae54e08b 100644 --- a/spec/lib/good_job/log_subscriber_spec.rb +++ b/spec/lib/good_job/log_subscriber_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::LogSubscriber do diff --git a/spec/lib/good_job/multi_scheduler_spec.rb b/spec/lib/good_job/multi_scheduler_spec.rb index 3fa4ffbec..fa369aef7 100644 --- a/spec/lib/good_job/multi_scheduler_spec.rb +++ b/spec/lib/good_job/multi_scheduler_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::MultiScheduler do diff --git a/spec/lib/good_job/notifier_spec.rb b/spec/lib/good_job/notifier_spec.rb index e099fda6b..1fb52867d 100644 --- a/spec/lib/good_job/notifier_spec.rb +++ b/spec/lib/good_job/notifier_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::Notifier do diff --git a/spec/lib/good_job/poller_spec.rb b/spec/lib/good_job/poller_spec.rb index 39370bab0..4a224bf10 100644 --- a/spec/lib/good_job/poller_spec.rb +++ b/spec/lib/good_job/poller_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::Poller do diff --git a/spec/lib/good_job/probe_server_spec.rb b/spec/lib/good_job/probe_server_spec.rb index f812e469d..10353cad5 100644 --- a/spec/lib/good_job/probe_server_spec.rb +++ b/spec/lib/good_job/probe_server_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' require 'net/http' diff --git a/spec/lib/good_job/scheduler_spec.rb b/spec/lib/good_job/scheduler_spec.rb index 93ce983a5..faac0302c 100644 --- a/spec/lib/good_job/scheduler_spec.rb +++ b/spec/lib/good_job/scheduler_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' RSpec.describe GoodJob::Scheduler do diff --git a/spec/lib/good_job_spec.rb b/spec/lib/good_job_spec.rb index b6679711a..2f1ab8efe 100644 --- a/spec/lib/good_job_spec.rb +++ b/spec/lib/good_job_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' describe GoodJob do diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 4a01761c3..89d428b59 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # This file is copied to spec/ when you run 'rails generate rspec:install' require 'spec_helper' ENV['RAILS_ENV'] ||= 'test' diff --git a/spec/requests/good_job/cron_entries_controller_spec.rb b/spec/requests/good_job/cron_entries_controller_spec.rb index bfb4f81e9..afcc1966d 100644 --- a/spec/requests/good_job/cron_entries_controller_spec.rb +++ b/spec/requests/good_job/cron_entries_controller_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' describe GoodJob::CronEntriesController do diff --git a/spec/requests/good_job/frontends_controller_spec.rb b/spec/requests/good_job/frontends_controller_spec.rb index 1bdb82970..be3613a9f 100644 --- a/spec/requests/good_job/frontends_controller_spec.rb +++ b/spec/requests/good_job/frontends_controller_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' describe GoodJob::FrontendsController do diff --git a/spec/requests/good_job/jobs_controller_spec.rb b/spec/requests/good_job/jobs_controller_spec.rb index 8e247fa71..a0b7dcc55 100644 --- a/spec/requests/good_job/jobs_controller_spec.rb +++ b/spec/requests/good_job/jobs_controller_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' describe GoodJob::JobsController do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 27154542c..c70c99f52 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # This file was generated by the `rails generate rspec:install` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # The generated `.rspec` file contains `--require spec_helper` which will cause diff --git a/spec/support/database_cleaner.rb b/spec/support/database_cleaner.rb index c6709eb46..c55bb7a58 100644 --- a/spec/support/database_cleaner.rb +++ b/spec/support/database_cleaner.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + RSpec.configure do |config| # Disabled because this causes the same database connection to be reused across threads # which causes Advisory Locks to not be effective because they are locked per-connection/per-thread. diff --git a/spec/support/example_app_helper.rb b/spec/support/example_app_helper.rb index 70ab9af75..7f4397493 100644 --- a/spec/support/example_app_helper.rb +++ b/spec/support/example_app_helper.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'fileutils' module ExampleAppHelper diff --git a/spec/support/jruby.rb b/spec/support/jruby.rb index e86602ace..deab90879 100644 --- a/spec/support/jruby.rb +++ b/spec/support/jruby.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + RSpec.configure do |c| if RUBY_PLATFORM.include?('java') puts "Excluding System Tests in JRuby" diff --git a/spec/support/output_helper.rb b/spec/support/output_helper.rb index 1ed5cfe89..7c85f0785 100644 --- a/spec/support/output_helper.rb +++ b/spec/support/output_helper.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module OutputHelper def quiet(&block) if ENV['LOUD'].present? diff --git a/spec/support/postgres_notices.rb b/spec/support/postgres_notices.rb index 9257f51fa..1af9e9a6e 100644 --- a/spec/support/postgres_notices.rb +++ b/spec/support/postgres_notices.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # # Raise an exception when Postgres writes a notice to $stderr # diff --git a/spec/support/pre_documentation_formatter.rb b/spec/support/pre_documentation_formatter.rb index 65c701449..99dbd8a5e 100644 --- a/spec/support/pre_documentation_formatter.rb +++ b/spec/support/pre_documentation_formatter.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + RSpec::Support.require_rspec_core "formatters/base_text_formatter" RSpec::Support.require_rspec_core "formatters/console_codes" diff --git a/spec/support/rails_versions.rb b/spec/support/rails_versions.rb index 9a508b54e..8a8eb47ba 100644 --- a/spec/support/rails_versions.rb +++ b/spec/support/rails_versions.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + RSpec.configure do |c| less_than_rails_6 = Gem::Version.new(Rails.version) < Gem::Version.new('6') c.filter_run_excluding(:skip_rails_5) if less_than_rails_6 diff --git a/spec/support/reset_good_job.rb b/spec/support/reset_good_job.rb index dc7318231..f552c6ed7 100644 --- a/spec/support/reset_good_job.rb +++ b/spec/support/reset_good_job.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + THREAD_ERRORS = Concurrent::Array.new RSpec.configure do |config| diff --git a/spec/support/reset_rails_queue_adapter.rb b/spec/support/reset_rails_queue_adapter.rb index 8098ebdb0..5dca81118 100644 --- a/spec/support/reset_rails_queue_adapter.rb +++ b/spec/support/reset_rails_queue_adapter.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + RSpec.configure do |config| config.prepend_before do # https://github.com/rails/rails/issues/37270 diff --git a/spec/support/rspec_not_change.rb b/spec/support/rspec_not_change.rb index 8f0ffae77..8ef469498 100644 --- a/spec/support/rspec_not_change.rb +++ b/spec/support/rspec_not_change.rb @@ -1,2 +1,3 @@ # frozen_string_literal: true + RSpec::Matchers.define_negated_matcher :not_change, :change diff --git a/spec/support/shell_out.rb b/spec/support/shell_out.rb index 568dab33d..05712afe6 100644 --- a/spec/support/shell_out.rb +++ b/spec/support/shell_out.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'open3' class ShellOut diff --git a/spec/support/sleep_helper.rb b/spec/support/sleep_helper.rb index af489dc3d..b99301680 100644 --- a/spec/support/sleep_helper.rb +++ b/spec/support/sleep_helper.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module SleepHelper TooSlowError = Class.new(StandardError) diff --git a/spec/support/sql_helper.rb b/spec/support/sql_helper.rb index 81f60b57a..683033337 100644 --- a/spec/support/sql_helper.rb +++ b/spec/support/sql_helper.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module SqlHelper def normalize_sql(sql) sql.gsub(/\s/, ' ').gsub(/([()])/, ' \1 ').squish diff --git a/spec/support/system.rb b/spec/support/system.rb index a1d292821..667c115dd 100644 --- a/spec/support/system.rb +++ b/spec/support/system.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "selenium-webdriver" Capybara.default_max_wait_time = 2 diff --git a/spec/support/time_helpers.rb b/spec/support/time_helpers.rb index f92f25031..af626fcac 100644 --- a/spec/support/time_helpers.rb +++ b/spec/support/time_helpers.rb @@ -1,2 +1,3 @@ # frozen_string_literal: true + RSpec.configure { |c| c.include ActiveSupport::Testing::TimeHelpers } diff --git a/spec/system/cron_entries_spec.rb b/spec/system/cron_entries_spec.rb index 635c09b7f..27c4fb250 100644 --- a/spec/system/cron_entries_spec.rb +++ b/spec/system/cron_entries_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' describe 'Cron Schedules' do diff --git a/spec/system/i18n_spec.rb b/spec/system/i18n_spec.rb index 43cec7987..7c7c88e5c 100644 --- a/spec/system/i18n_spec.rb +++ b/spec/system/i18n_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' describe 'I18n Internationalization', js: true do diff --git a/spec/system/jobs_spec.rb b/spec/system/jobs_spec.rb index d1f14370f..e1cd9c3af 100644 --- a/spec/system/jobs_spec.rb +++ b/spec/system/jobs_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' describe 'Jobs', js: true do diff --git a/spec/system/live_poll_spec.rb b/spec/system/live_poll_spec.rb index ba6c2eb93..85f4f0045 100644 --- a/spec/system/live_poll_spec.rb +++ b/spec/system/live_poll_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'rails_helper' describe 'Live Poll', js: true do