Skip to content

Commit

Permalink
Merge pull request #14 from VitalConnectInc/bugfix/13-delay-loading-p…
Browse files Browse the repository at this point in the history
…arallel-tests-tasks

🐛 Delay loading of parallel-tests' tasks
  • Loading branch information
pboling authored Feb 4, 2025
2 parents 03d903c + bda5069 commit a32d787
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
16 changes: 8 additions & 8 deletions .rubocop_gradual.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
[50, 5, 269, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 4255608859],
[71, 5, 614, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 574527918]
],
"lib/turbo_tests/runner.rb:1439137339": [
[13, 5, 271, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 21989008],
[20, 5, 1400, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 1925027850],
[237, 11, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
[256, 47, 6, "Style/GlobalStdStream: Use `$stderr` instead of `STDERR`.", 3356712163],
[258, 21, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
[267, 7, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
[327, 9, 6, "Style/GlobalStdStream: Use `$stdout` instead of `STDOUT`.", 3356722952]
"lib/turbo_tests/runner.rb:3014787945": [
[12, 5, 479, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 1520723843],
[23, 5, 1400, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 1925027850],
[240, 11, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
[259, 47, 6, "Style/GlobalStdStream: Use `$stderr` instead of `STDERR`.", 3356712163],
[261, 21, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
[270, 7, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
[330, 9, 6, "Style/GlobalStdStream: Use `$stdout` instead of `STDOUT`.", 3356722952]
],
"spec/cli_spec.rb:3990998076": [
[1, 1, 30, "RSpec/SpecFilePathFormat: Spec path should end with `turbo_tests/cli*_spec.rb`.", 965721356],
Expand Down
5 changes: 4 additions & 1 deletion lib/turbo_tests/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

require "json"
require "parallel_tests/rspec/runner"
require "parallel_tests/tasks"

require_relative "../utils/hash_extension"

Expand All @@ -11,6 +10,10 @@ class Runner
using CoreExtensions

def self.create(count)
# We are unable to load parallel tests' tasks in the normal way (top of file)
# because it requires that the Rails.application instance already be configured
require "parallel_tests/tasks"

ENV["PARALLEL_TEST_FIRST_IS_1"] = "true"
command = ["bundle", "exec", "rake", "db:create", "RAILS_ENV=#{ParallelTests::Tasks.rails_env}"]
args = {count: count.to_s}
Expand Down
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require "turbo_tests"

require "parallel_tests/tasks"

RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
Expand Down

0 comments on commit a32d787

Please sign in to comment.