Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spec to Backtrace::APP_DIRS_PATTERN #2029

Merged
merged 1 commit into from
Apr 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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