Skip to content

Commit

Permalink
fix: Don't mutate original enabled_environments
Browse files Browse the repository at this point in the history
Ensure enabled_environments contains test environment without mutating
original list.

See: getsentry#2269 (comment)
  • Loading branch information
ixti committed Mar 22, 2024
1 parent ffffce9 commit a573841
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Bug Fixes

- Don't instantiate connection in `ActiveRecordSubscriber` ([#2278](https://github.com/getsentry/sentry-ruby/pull/2278))
- Don't mutate original `enabled_environments` when using test helpers ([#2275](https://github.com/getsentry/sentry-ruby/pull/2275))

## 5.17.1

Expand Down
2 changes: 1 addition & 1 deletion sentry-ruby/lib/sentry/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def setup_sentry_test(&block)
# set transport to DummyTransport, so we can easily intercept the captured events
dummy_config.transport.transport_class = Sentry::DummyTransport
# make sure SDK allows sending under the current environment
dummy_config.enabled_environments << dummy_config.environment unless dummy_config.enabled_environments.include?(dummy_config.environment)
dummy_config.enabled_environments |= [dummy_config.environment] unless dummy_config.enabled_environments.include?(dummy_config.environment)
# disble async event sending
dummy_config.background_worker_threads = 0

Expand Down

0 comments on commit a573841

Please sign in to comment.