Skip to content

Commit 56aa853

Browse files
committed
fix test with vocab change and keep hackney options
1 parent 26f6c73 commit 56aa853

File tree

7 files changed

+54
-31
lines changed

7 files changed

+54
-31
lines changed

lib/sentry/config.ex

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,35 @@ defmodule Sentry.Config do
324324
`Sentry.FinchClient`.
325325
"""
326326
]
327+
# hackney_opts: [
328+
# type: :keyword_list,
329+
# deprecated: "Use Finch instead as default client.",
330+
# default: [pool: :sentry_pool],
331+
# doc: """
332+
# Options to be passed to `hackney`. Only
333+
# applied if `:client` is set to `Sentry.HackneyClient`.
334+
# """
335+
# ],
336+
# hackney_pool_timeout: [
337+
# type: :timeout,
338+
# deprecated: "Use Finch instead as default client.",
339+
# default: 5000,
340+
# doc: """
341+
# The maximum time to wait for a
342+
# connection to become available. Only applied if `:client` is set to
343+
# `Sentry.HackneyClient`.
344+
# """
345+
# ],
346+
# hackney_pool_max_connections: [
347+
# type: :pos_integer,
348+
# deprecated: "Use Finch instead as default client.",
349+
# default: 50,
350+
# doc: """
351+
# The maximum number of
352+
# connections to keep in the pool. Only applied if `:client` is set to
353+
# `Sentry.HackneyClient`.
354+
# """
355+
# ]
327356
]
328357

329358
source_code_context_opts_schema = [

lib/sentry/finch_client.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ defmodule Sentry.FinchClient do
1111
HTTP client, you'll have to implement your own `Sentry.HTTPClient`. See the
1212
documentation for `Sentry.HTTPClient` for more information.
1313
14-
Finch is built on top of NimblePool. If you need to set other pool configuration options,
15-
see "Pool Configuration Options" in the source code for details on the possible map values.
16-
[finch configuration options](https://github.com/sneako/finch/blob/main/lib/finch.ex)
14+
Finch is built on top of [NimblePool](https://github.com/dashbitco/nimble_pool). If you need to set other pool configuration options,
15+
see "Pool Configuration Options" in the Finch documentation for details on the possible map values.
16+
[finch configuration options](https://hexdocs.pm/finch/Finch.html#start_link/1-pool-configuration-options)
1717
"""
1818
@impl true
1919
def child_spec do

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ defmodule Sentry.Mixfile do
9494
{:nimble_ownership, "~> 0.3.0 or ~> 1.0"},
9595

9696
# Optional dependencies
97-
{:finch, "~> 0.18.0", optional: true},
97+
{:finch, "~> 0.19.0", optional: true},
9898
{:jason, "~> 1.1", optional: true},
9999
{:phoenix, "~> 1.6", optional: true},
100100
{:phoenix_live_view, "~> 0.20 or ~> 1.0", optional: true},

mix.lock

Lines changed: 16 additions & 22 deletions
Large diffs are not rendered by default.

test/mix/sentry.send_test_event_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ defmodule Mix.Tasks.Sentry.SendTestEventTest do
1515
assert output =~ """
1616
Client configuration:
1717
current environment_name: "some_env"
18-
finch_opts: []
18+
Finch options: []
1919
"""
2020

2121
assert output =~ ~s(Event not sent because the :dsn option is not set)
@@ -49,7 +49,7 @@ defmodule Mix.Tasks.Sentry.SendTestEventTest do
4949
public_key: public
5050
secret_key: secret
5151
current environment_name: "test"
52-
finch_opts: []
52+
Finch options: []
5353
"""
5454

5555
assert output =~ "Sending test event..."

test/sentry/logger_handler_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ defmodule Sentry.LoggerHandlerTest do
696696
put_test_config(
697697
dsn: "http://public:secret@localhost:#{bypass.port}/1",
698698
dedup_events: false,
699-
hackney_opts: [recv_timeout: 500, pool: :sentry_pool]
699+
finch_opts: []
700700
)
701701

702702
Bypass.expect(bypass, fn conn ->

test/sentry/transport_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,12 @@ defmodule Sentry.TransportTest do
246246

247247
assert :too_many_retries =
248248
error(fn ->
249-
Transport.encode_and_post_envelope(envelope, HackneyClient, _retries = [])
249+
Transport.encode_and_post_envelope(envelope, FinchClient, _retries = [])
250250
end)
251251

252252
log =
253253
capture_log(fn ->
254-
Transport.encode_and_post_envelope(envelope, HackneyClient, _retries = [])
254+
Transport.encode_and_post_envelope(envelope, FinchClient, _retries = [])
255255
end)
256256

257257
assert log =~ "[warning]"

0 commit comments

Comments
 (0)