DEV: Remove backtrace warning (#30093)

Followup aca6c462a6

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.
This commit is contained in:
Martin Brennan 2024-12-04 14:14:36 +10:00 committed by GitHub
parent 28b4ff6cb6
commit ad7a64b983
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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