mirror of
https://github.com/discourse/discourse.git
synced 2025-03-06 16:25:20 +08:00

Followup: * https://github.com/discourse/discourse/pull/28160 * https://github.com/discourse/discourse/pull/25921 In the previous PRs we added 2 environent variables to control backtrace output for errors in rspec, `RSPEC_EXCLUDE_NOISE_IN_BACKTRACE`, and `RSPEC_EXCLUDE_GEMS_IN_BACKTRACE` These largely do the same thing, and we want to enable that behaviour by default. This commit consolidates them into one env var, `DISCOURSE_INCLUDE_GEMS_IN_RSPEC_BACKTRACE`, which is disabled by default, meaning gem backtraces will not be shown in rspec backtraces by default. Also for the request spec use case with `RspecErrorTracker`, we now show an indicator of how many lines were hidden from the backtrace e.g. "...(21 framework line(s) excluded)", and for this and the normal rspec backtrace exclusion we show a warning if `DISCOURSE_INCLUDE_GEMS_IN_RSPEC_BACKTRACE` is not enabled.