diff --git a/lib/knapsack_pro/runners/queue/rspec_runner.rb b/lib/knapsack_pro/runners/queue/rspec_runner.rb index 57cafff0..6853eed3 100644 --- a/lib/knapsack_pro/runners/queue/rspec_runner.rb +++ b/lib/knapsack_pro/runners/queue/rspec_runner.rb @@ -56,6 +56,8 @@ def run Kernel.exit(exit_code) rescue Exception => exception KnapsackPro.logger.error("An unexpected exception happened. RSpec cannot handle it. The exception: #{exception.inspect}") + KnapsackPro.logger.error("Exception message: #{exception.message}") + KnapsackPro.logger.error("Exception backtrace: #{exception.backtrace.join("\n")}") message = @rspec_pure.exit_summary(unexecuted_test_files) KnapsackPro.logger.warn(message) if message diff --git a/spec/integration/runners/queue/rspec_runner_spec.rb b/spec/integration/runners/queue/rspec_runner_spec.rb index 1c76cd17..75c947b7 100644 --- a/spec/integration/runners/queue/rspec_runner_spec.rb +++ b/spec/integration/runners/queue/rspec_runner_spec.rb @@ -1115,6 +1115,8 @@ def when_first_matching_example_defined(type:) expect(actual.stdout).to include('B_describe') expect(actual.stdout).to include('An unexpected exception happened. RSpec cannot handle it. The exception: #') + expect(actual.stdout).to include('Exception message: ') + expect(actual.stdout).to include('Exception backtrace: ') expect(actual.stdout).to_not include('B1 test example') expect(actual.stdout).to_not include('C1 test example')