Skip to content

Commit

Permalink
Add spec to Backtrace::APP_DIRS_PATTERN
Browse files Browse the repository at this point in the history
  • Loading branch information
sl0thentr0py committed Apr 6, 2023
1 parent d45f720 commit 3031948
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
## Unreleased

- Forward all `baggage` header items that are prefixed with `sentry-` [#2025](https://github.com/getsentry/sentry-ruby/pull/2025)

### Features

- Add new boolean option `config.enable_tracing` to simplify enabling performance tracing [#2005](https://github.com/getsentry/sentry-ruby/pull/2005)
Expand All @@ -16,6 +14,8 @@
Sentry.capture_exception(ignored_exception) # won't be sent to Sentry
Sentry.capture_exception(ignored_exception, hint: { ignore_exclusions: true }) # will be sent to Sentry
```
- Add `spec` to `Backtrace::APP_DIRS_PATTERN` [#2029](https://github.com/getsentry/sentry-ruby/pull/2029)
- Forward all `baggage` header items that are prefixed with `sentry-` [#2025](https://github.com/getsentry/sentry-ruby/pull/2025)

### Bug Fixes

Expand Down
2 changes: 1 addition & 1 deletion sentry-ruby/lib/sentry/backtrace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def inspect
end
end

APP_DIRS_PATTERN = /(bin|exe|app|config|lib|test)/.freeze
APP_DIRS_PATTERN = /(bin|exe|app|config|lib|test|spec)/.freeze

# holder for an Array of Backtrace::Line instances
attr_reader :lines
Expand Down
6 changes: 3 additions & 3 deletions sentry-ruby/spec/sentry/interfaces/stacktrace_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
let(:configuration) { Sentry::Configuration.new }
let(:raw_lines) do
[
"#{__FILE__}:10:in `test_method'",
"#{Dir.home}/.rvm/gems/activerecord/base.rb:10:in `save'",
"#{configuration.project_root}/app/models/post.rb:5:in `save_user'"
]
end
Expand All @@ -16,9 +16,9 @@
it "initializes a Frame with the correct info from the given Backtrace::Line object" do
first_frame = Sentry::StacktraceInterface::Frame.new(configuration.project_root, lines.first)

expect(first_frame.filename).to match(/stacktrace_spec.rb/)
expect(first_frame.filename).to match(/base.rb/)
expect(first_frame.in_app).to eq(false)
expect(first_frame.function).to eq("test_method")
expect(first_frame.function).to eq("save")
expect(first_frame.lineno).to eq(10)

second_frame = Sentry::StacktraceInterface::Frame.new(configuration.project_root, lines.last)
Expand Down

0 comments on commit 3031948

Please sign in to comment.