DEV: Add ENV var to skip verbose gem backtrace in rspec failure (#25921)
In rspec request specs, we do a huge verbose backtrace when there is an error. However, 99% of the time you don't care about pages and pages of activesupport/rspec gem LOC in the backtrace...so this commit introduces an env var RSPEC_EXCLUDE_GEMS_IN_BACKTRACE to allow for turning this off.
This commit is contained in:
parent
9e9673fac5
commit
42d203d773
|
@ -695,7 +695,12 @@ RSpec.configure do |config|
|
|||
lines << "\n"
|
||||
lines << "Error encountered while proccessing #{path}"
|
||||
lines << " #{ex.class}: #{ex.message}"
|
||||
ex.backtrace.each { |line| lines << " #{line}\n" }
|
||||
ex.backtrace.each_with_index do |line, backtrace_index|
|
||||
if ENV["RSPEC_EXCLUDE_GEMS_IN_BACKTRACE"]
|
||||
next if line.match?(%r{/gems/})
|
||||
end
|
||||
lines << " #{line}\n"
|
||||
end
|
||||
end
|
||||
|
||||
lines << "~~~~~~~ END SERVER EXCEPTIONS ~~~~~~~"
|
||||
|
|
Loading…
Reference in New Issue