From ad7a64b983bb6ec18c0919ad37f8f8ac9ae33c69 Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Wed, 4 Dec 2024 14:14:36 +1000 Subject: [PATCH] DEV: Remove backtrace warning (#30093) Followup aca6c462a6af0eab53c7ea5820f2a9c65c5a88c7 Remove the warning message if DISCOURSE_INCLUDE_GEMS_IN_RSPEC_BACKTRACE is not set for now while we decide whether we want to include this or not, it's a little in-your-face. --- spec/rails_helper.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 7e78157d6bd..47882ffac36 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -689,13 +689,6 @@ RSpec.configure do |config| end config.after :each do |example| - # This behaviour is enabled by default, to include gems in - # the backtrace set DISCOURSE_INCLUDE_GEMS_IN_RSPEC_BACKTRACE=1 - if example.exception && ENV["DISCOURSE_INCLUDE_GEMS_IN_RSPEC_BACKTRACE"] != "1" - lines = (RSpec.current_example.metadata[:extra_failure_lines] ||= +"") - lines << "Warning: DISCOURSE_INCLUDE_GEMS_IN_RSPEC_BACKTRACE has not been enabled, gem backtrace will be excluded from the output\n" - end - if example.exception && RspecErrorTracker.exceptions.present? lines = (RSpec.current_example.metadata[:extra_failure_lines] ||= +"") @@ -710,6 +703,8 @@ RSpec.configure do |config| framework_lines_excluded = 0 ex.backtrace.each_with_index do |line, backtrace_index| + # This behaviour is enabled by default, to include gems in + # the backtrace set DISCOURSE_INCLUDE_GEMS_IN_RSPEC_BACKTRACE=1 if ENV["DISCOURSE_INCLUDE_GEMS_IN_RSPEC_BACKTRACE"] != "1" if line.match?(%r{/gems/}) framework_lines_excluded += 1