Skip to content

Commit 37a31e0

Browse files
Update minimum Elixir to 12, update ci and tool-versions (#335)
* Update minimum Elixir to 12, update ci and tool-versions * chore: dialyzer and format! * chore: make some tests pass * test: make tests pass * fix: remove statix/statsd --------- Co-authored-by: Paulo Valente <[email protected]>
1 parent 226cec3 commit 37a31e0

File tree

21 files changed

+68
-69
lines changed

21 files changed

+68
-69
lines changed

.github/workflows/ci.yml

+29-17
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@v3
1717
- uses: erlef/setup-beam@v1
1818
with:
19-
otp-version: 25.1.x
19+
otp-version: 26.1.x
2020
elixir-version: 1.14.x
2121
- name: Retrieve dependencies cache
2222
uses: actions/cache@v3
@@ -33,15 +33,21 @@ jobs:
3333
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
3434
strategy:
3535
matrix:
36-
otp: [22.x, 23.x, 24.x, 25.1.x]
37-
elixir: [1.11.x, 1.12.x, 1.13.x, 1.14.x]
36+
otp: [23.x, 24.x, 25.1.x, 26.1.x]
37+
elixir: [1.12.x, 1.13.x, 1.14.x, 1.15.x]
3838
exclude:
3939
- otp: 25.1.x
40-
elixir: 1.11.x
41-
- otp: 25.1.x
4240
elixir: 1.12.x
43-
- otp: 22.x
41+
- otp: 26.1.x
42+
elixir: 1.12.x
43+
- otp: 25.1.x
44+
elixir: 1.13.x
45+
- otp: 26.1.x
46+
elixir: 1.13.x
47+
- otp: 26.1.x
4448
elixir: 1.14.x
49+
- otp: 23.x
50+
elixir: 1.15.x
4551
needs: check_format
4652
steps:
4753
- uses: actions/checkout@v3
@@ -68,8 +74,8 @@ jobs:
6874
- uses: actions/checkout@v3
6975
- uses: erlef/setup-beam@v1
7076
with:
71-
otp-version: 25.1.x
72-
elixir-version: 1.14.x
77+
otp-version: 26.1.x
78+
elixir-version: 1.15.x
7379
- name: Retrieve dependencies cache
7480
uses: actions/cache@v3
7581
id: mix-cache # id to use in retrieve action
@@ -90,15 +96,21 @@ jobs:
9096
if: ${{ github.ref == 'refs/heads/master' }}
9197
strategy:
9298
matrix:
93-
otp: [22.x, 23.x, 24.x, 25.1.x]
94-
elixir: [1.11.x, 1.12.x, 1.13.x, 1.14.x]
99+
otp: [23.x, 24.x, 25.1.x, 26.1.x]
100+
elixir: [1.12.x, 1.13.x, 1.14.x, 1.15.x]
95101
exclude:
96102
- otp: 25.1.x
97-
elixir: 1.11.x
98-
- otp: 25.1.x
99103
elixir: 1.12.x
100-
- otp: 22.x
104+
- otp: 26.1.x
105+
elixir: 1.12.x
106+
- otp: 25.1.x
107+
elixir: 1.13.x
108+
- otp: 26.1.x
109+
elixir: 1.13.x
110+
- otp: 26.1.x
101111
elixir: 1.14.x
112+
- otp: 23.x
113+
elixir: 1.15.x
102114
steps:
103115
- uses: actions/checkout@v3
104116
- uses: erlef/setup-beam@v1
@@ -123,8 +135,8 @@ jobs:
123135
runs-on: ubuntu-20.04
124136
strategy:
125137
matrix:
126-
otp: [24.x, 25.1.x]
127-
elixir: [1.14.x]
138+
otp: [25.1.x, 26.1.x]
139+
elixir: [1.15.x]
128140
env:
129141
MIX_ENV: test
130142
steps:
@@ -157,8 +169,8 @@ jobs:
157169
- uses: actions/checkout@v3
158170
- uses: erlef/setup-beam@v1
159171
with:
160-
otp-version: 25.1.x
161-
elixir-version: 1.14.x
172+
otp-version: 26.1.x
173+
elixir-version: 1.15.x
162174
- name: Retrieve dependencies cache
163175
uses: actions/cache@v3
164176
id: mix-cache # id to use in retrieve action

.tool-versions

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
elixir 1.14.2-otp-25
2-
erlang 25.1.1
1+
elixir 1.15.7-otp-26
2+
erlang 26.1.2

benchmark/config/prod.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import Config
22

3-
config :logger, level: :warn
3+
config :logger, level: :warning

examples/helloworld/config/prod.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import Config
22

33
config :logger,
4-
level: :warn
4+
level: :warning

interop/config/config.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import Config
22

3-
config :logger, level: :warn
3+
config :logger, level: :warning

interop/lib/interop/app.ex

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ defmodule Interop.App do
44
def start(_type, _args) do
55
children = [{GRPC.Server.Supervisor, endpoint: Interop.Endpoint, port: 10000}]
66

7-
Interop.ServerInterceptor.Statix.connect()
8-
97
opts = [strategy: :one_for_one, name: __MODULE__]
108
Supervisor.start_link(children, opts)
119
end

interop/lib/interop/endpoint.ex

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
defmodule Interop.Endpoint do
22
use GRPC.Endpoint
33

4-
intercept Interop.ServerInterceptor
5-
64
run Interop.Server
75
end

interop/lib/interop/stats_interceptor.ex

-7
This file was deleted.

interop/mix.exs

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ defmodule Interop.MixProject do
2323
defp deps do
2424
[
2525
{:grpc, path: "..", override: true},
26-
{:protobuf, "~> 0.11"},
27-
{:grpc_statsd, "~> 0.1.0"},
28-
{:statix, ">= 1.2.1"},
29-
{:extrace, "~> 0.2"},
26+
{:protobuf, "~> 0.11"}
3027
]
3128
end
3229
end

interop/mix.lock

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
%{
2-
"cowboy": {:hex, :cowboy, "2.9.0", "865dd8b6607e14cf03282e10e934023a1bd8be6f6bacf921a7e2a96d800cd452", [:make, :rebar3], [{:cowlib, "2.11.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "2c729f934b4e1aa149aff882f57c6372c15399a20d54f65c8d67bef583021bde"},
3-
"cowlib": {:hex, :cowlib, "2.11.0", "0b9ff9c346629256c42ebe1eeb769a83c6cb771a6ee5960bd110ab0b9b872063", [:make, :rebar3], [], "hexpm", "2b3e9da0b21c4565751a6d4901c20d1b4cc25cbb7fd50d91d2ab6dd287bc86a9"},
4-
"extrace": {:hex, :extrace, "0.2.1", "e234f1f64df8c989771b7b5d047a3412f10512c0e3d414fc7eb0e8fc633779f8", [:mix], [{:recon, "~> 2.5", [hex: :recon, repo: "hexpm", optional: false]}], "hexpm", "1b2d9fc4bacc208d5aaa97f61e7c47b66ff4dfc155e9b95647e68ca316ab3981"},
2+
"cowboy": {:hex, :cowboy, "2.10.0", "ff9ffeff91dae4ae270dd975642997afe2a1179d94b1887863e43f681a203e26", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "3afdccb7183cc6f143cb14d3cf51fa00e53db9ec80cdcd525482f5e99bc41d6b"},
3+
"cowlib": {:hex, :cowlib, "2.12.1", "a9fa9a625f1d2025fe6b462cb865881329b5caff8f1854d1cbc9f9533f00e1e1", [:make, :rebar3], [], "hexpm", "163b73f6367a7341b33c794c4e88e7dbfe6498ac42dcd69ef44c5bc5507c8db0"},
54
"grpc": {:git, "https://github.com/elixir-grpc/grpc.git", "21422839798e49bf6d29327fab0a7add51becedd", []},
6-
"grpc_statsd": {:hex, :grpc_statsd, "0.1.0", "a95ae388188486043f92a3c5091c143f5a646d6af80c9da5ee616546c4d8f5ff", [:mix], [{:grpc, ">= 0.0.0", [hex: :grpc, repo: "hexpm", optional: true]}, {:statix, ">= 0.0.0", [hex: :statix, repo: "hexpm", optional: true]}], "hexpm", "de0c05db313c7b3ffeff345855d173fd82fec3de16591a126b673f7f698d9e74"},
7-
"gun": {:hex, :grpc_gun, "2.0.1", "221b792df3a93e8fead96f697cbaf920120deacced85c6cd3329d2e67f0871f8", [:rebar3], [{:cowlib, "~> 2.11", [hex: :cowlib, repo: "hexpm", optional: false]}], "hexpm", "795a65eb9d0ba16697e6b0e1886009ce024799e43bb42753f0c59b029f592831"},
5+
"gun": {:hex, :gun, "2.0.1", "160a9a5394800fcba41bc7e6d421295cf9a7894c2252c0678244948e3336ad73", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}], "hexpm", "a10bc8d6096b9502205022334f719cc9a08d9adcfbfc0dbee9ef31b56274a20b"},
86
"hpax": {:hex, :hpax, "0.1.2", "09a75600d9d8bbd064cdd741f21fc06fc1f4cf3d0fcc335e5aa19be1a7235c84", [:mix], [], "hexpm", "2c87843d5a23f5f16748ebe77969880e29809580efdaccd615cd3bed628a8c13"},
9-
"mint": {:hex, :mint, "1.4.2", "50330223429a6e1260b2ca5415f69b0ab086141bc76dc2fbf34d7c389a6675b2", [:mix], [{:castore, "~> 0.1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "ce75a5bbcc59b4d7d8d70f8b2fc284b1751ffb35c7b6a6302b5192f8ab4ddd80"},
7+
"mint": {:hex, :mint, "1.5.1", "8db5239e56738552d85af398798c80648db0e90f343c8469f6c6d8898944fb6f", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "4a63e1e76a7c3956abd2c72f370a0d0aecddc3976dea5c27eccbecfa5e7d5b1e"},
108
"protobuf": {:hex, :protobuf, "0.11.0", "58d5531abadea3f71135e97bd214da53b21adcdb5b1420aee63f4be8173ec927", [:mix], [{:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "30ad9a867a5c5a0616cac9765c4d2c2b7b0030fa81ea6d0c14c2eb5affb6ac52"},
119
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
12-
"recon": {:hex, :recon, "2.5.0", "2f7fcbec2c35034bade2f9717f77059dc54eb4e929a3049ca7ba6775c0bd66cd", [:mix, :rebar3], [], "hexpm", "72f3840fedd94f06315c523f6cecf5b4827233bed7ae3fe135b2a0ebeab5e196"},
13-
"statix": {:hex, :statix, "1.2.1", "4f23c8cc2477ea0de89fed5e34f08c54b0d28b838f7b8f26613155f2221bb31e", [:mix], [], "hexpm", "7f988988fddcce19ae376bb8e47aa5ea5dabf8d4ba78d34d1ae61eb537daf72e"},
10+
"telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"},
1411
}

interop/script/run.exs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
{options, _, _} = OptionParser.parse(System.argv(), strict: [rounds: :integer, concurrency: :integer, port: :integer])
1+
{options, _, _} = OptionParser.parse(System.argv(), strict: [rounds: :integer, concurrency: :integer, port: :integer, level: :string])
22
rounds = Keyword.get(options, :rounds) || 20
33
max_concurrency = System.schedulers_online()
44
concurrency = Keyword.get(options, :concurrency) || max_concurrency
55
port = Keyword.get(options, :port) || 0
6-
level = Keyword.get(options, :log_level) || "warn"
6+
level = Keyword.get(options, :level) || "warning"
77
level = String.to_existing_atom(level)
88

99
require Logger

lib/grpc/client/interceptors/logger.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ defmodule GRPC.Client.Interceptors.Logger do
1515
1616
## Usage with custom level
1717
18-
{:ok, channel} = GRPC.Stub.connect("localhost:50051", interceptors: [{GRPC.Client.Interceptors.Logger, level: :warn}])
18+
{:ok, channel} = GRPC.Stub.connect("localhost:50051", interceptors: [{GRPC.Client.Interceptors.Logger, level: :warning}])
1919
"""
2020

2121
require Logger

lib/grpc/server/supervisor.ex

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ defmodule GRPC.Server.Supervisor do
2424
@type sup_flags() :: %{
2525
strategy: Supervisor.strategy(),
2626
intensity: non_neg_integer(),
27-
period: pos_integer()
27+
period: pos_integer(),
28+
auto_shutdown: Supervisor.auto_shutdown()
2829
}
2930

3031
@default_adapter GRPC.Server.Adapters.Cowboy

mix.exs

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ defmodule GRPC.Mixfile do
77
[
88
app: :grpc,
99
version: @version,
10-
elixir: "~> 1.11",
10+
elixir: "~> 1.12",
1111
elixirc_paths: elixirc_paths(Mix.env()),
1212
build_embedded: Mix.env() == :prod,
1313
start_permanent: Mix.env() == :prod,
@@ -21,7 +21,7 @@ defmodule GRPC.Mixfile do
2121
source_url: "https://github.com/elixir-grpc/grpc"
2222
],
2323
dialyzer: [
24-
plt_add_deps: :apps_tree,
24+
plt_add_deps: :app_tree,
2525
plt_add_apps: [:iex, :mix, :ex_unit],
2626
list_unused_filters: true,
2727
plt_file: {:no_warn, "_build/#{Mix.env()}/plts/dialyzer.plt"}
@@ -45,7 +45,7 @@ defmodule GRPC.Mixfile do
4545
{:cowlib, "~> 2.12"},
4646
{:protobuf, "~> 0.11", only: [:dev, :test]},
4747
{:ex_doc, "~> 0.29", only: :dev},
48-
{:dialyxir, "~> 1.1.0", only: [:dev, :test], runtime: false},
48+
{:dialyxir, "~> 1.4.0", only: [:dev, :test], runtime: false},
4949
{:ex_parameterized, "~> 1.3.7", only: :test},
5050
{:telemetry, "~> 1.0"}
5151
]

mix.lock

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
%{
2-
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"},
32
"cowboy": {:hex, :cowboy, "2.10.0", "ff9ffeff91dae4ae270dd975642997afe2a1179d94b1887863e43f681a203e26", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "3afdccb7183cc6f143cb14d3cf51fa00e53db9ec80cdcd525482f5e99bc41d6b"},
43
"cowlib": {:hex, :cowlib, "2.12.1", "a9fa9a625f1d2025fe6b462cb865881329b5caff8f1854d1cbc9f9533f00e1e1", [:make, :rebar3], [], "hexpm", "163b73f6367a7341b33c794c4e88e7dbfe6498ac42dcd69ef44c5bc5507c8db0"},
5-
"dialyxir": {:hex, :dialyxir, "1.1.0", "c5aab0d6e71e5522e77beff7ba9e08f8e02bad90dfbeffae60eaf0cb47e29488", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "07ea8e49c45f15264ebe6d5b93799d4dd56a44036cf42d0ad9c960bc266c0b9a"},
4+
"dialyxir": {:hex, :dialyxir, "1.4.2", "764a6e8e7a354f0ba95d58418178d486065ead1f69ad89782817c296d0d746a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "516603d8067b2fd585319e4b13d3674ad4f314a5902ba8130cd97dc902ce6bbd"},
65
"earmark_parser": {:hex, :earmark_parser, "1.4.32", "fa739a0ecfa34493de19426681b23f6814573faee95dfd4b4aafe15a7b5b32c6", [:mix], [], "hexpm", "b8b0dd77d60373e77a3d7e8afa598f325e49e8663a51bcc2b88ef41838cca755"},
76
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
87
"ex_doc": {:hex, :ex_doc, "0.29.4", "6257ecbb20c7396b1fe5accd55b7b0d23f44b6aa18017b415cb4c2b91d997729", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "2c6699a737ae46cb61e4ed012af931b57b699643b24dabe2400a8168414bc4f5"},
98
"ex_parameterized": {:hex, :ex_parameterized, "1.3.7", "801f85fc4651cb51f11b9835864c6ed8c5e5d79b1253506b5bb5421e8ab2f050", [:mix], [], "hexpm", "1fb0dc4aa9e8c12ae23806d03bcd64a5a0fc9cd3f4c5602ba72561c9b54a625c"},
109
"gun": {:hex, :gun, "2.0.1", "160a9a5394800fcba41bc7e6d421295cf9a7894c2252c0678244948e3336ad73", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}], "hexpm", "a10bc8d6096b9502205022334f719cc9a08d9adcfbfc0dbee9ef31b56274a20b"},
1110
"hpax": {:hex, :hpax, "0.1.2", "09a75600d9d8bbd064cdd741f21fc06fc1f4cf3d0fcc335e5aa19be1a7235c84", [:mix], [], "hexpm", "2c87843d5a23f5f16748ebe77969880e29809580efdaccd615cd3bed628a8c13"},
12-
"jason": {:hex, :jason, "1.3.0", "fa6b82a934feb176263ad2df0dbd91bf633d4a46ebfdffea0c8ae82953714946", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "53fc1f51255390e0ec7e50f9cb41e751c260d065dcba2bf0d08dc51a4002c2ac"},
1311
"makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"},
1412
"makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"},
1513
"makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"},

test/grpc/client/adapters/mint/connection_process_test.exs

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ defmodule GRPC.Client.Adapters.Mint.ConnectionProcessTest do
1616
end
1717

1818
describe "start_link/4" do
19-
test "non-successful connection stops the connection process without exit it's caller" do
19+
test "non-successful connection stops the connection process without exiting it's caller" do
20+
Process.flag(:trap_exit, true)
21+
2022
logs =
2123
capture_log(fn ->
2224
assert {:error, %Mint.TransportError{reason: :econnrefused}} ==

test/grpc/client/interceptors/logger_test.exs

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ defmodule GRPC.Client.Interceptors.LoggerTest do
4040
request = %FakeRequest{}
4141
stream = %Stream{grpc_type: :unary, rpc: @rpc, service_name: @service_name}
4242
next = fn _stream, _request -> {:ok, :ok} end
43-
opts = LoggerInterceptor.init(level: :warn)
43+
opts = LoggerInterceptor.init(level: :warning)
4444

4545
logs =
4646
capture_log(fn ->
@@ -65,7 +65,7 @@ defmodule GRPC.Client.Interceptors.LoggerTest do
6565
end
6666

6767
test "calls next when below :logger level" do
68-
Logger.configure(level: :warn)
68+
Logger.configure(level: :warning)
6969

7070
request = %FakeRequest{}
7171
stream = %Stream{grpc_type: :unary, rpc: @rpc, service_name: @service_name}

test/grpc/integration/server_test.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ defmodule GRPC.Integration.ServerTest do
138138
{:ok, reply} = channel |> Helloworld.Greeter.Stub.say_hello(req)
139139
assert reply.message == "Hello, Elixir"
140140

141-
{:ok, conn_pid} = :gun.open('localhost', port)
141+
{:ok, conn_pid} = :gun.open(~c"localhost", port)
142142
stream_ref = :gun.get(conn_pid, "/status")
143143

144144
assert_receive {:gun_response, ^conn_pid, ^stream_ref, :nofin, 200, _headers}

test/grpc/server/adapters/cowboy_test.exs

+10-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ defmodule GRPC.Server.Adapters.CowboyTest do
1515
])
1616

1717
socket_opts = get_socket_opts_from_child_spec(spec)
18-
assert socket_opts == [:inet, {:ipv6_v6only, false}, {:ip, {127, 0, 0, 1}}, {:port, 8080}]
18+
19+
assert Enum.sort(socket_opts) ==
20+
Enum.sort([:inet, {:ip, {127, 0, 0, 1}}, {:ipv6_v6only, false}, {:port, 8080}])
1921
end
2022

2123
test "produces the correct socket opts for ranch_tcp for inet6" do
@@ -30,12 +32,13 @@ defmodule GRPC.Server.Adapters.CowboyTest do
3032

3133
socket_opts = get_socket_opts_from_child_spec(spec)
3234

33-
assert socket_opts == [
34-
:inet6,
35-
{:ipv6_v6only, true},
36-
{:ip, {0, 0, 0, 0, 0, 0, 0, 1}},
37-
{:port, 8081}
38-
]
35+
assert Enum.sort(socket_opts) ==
36+
Enum.sort([
37+
:inet6,
38+
{:ip, {0, 0, 0, 0, 0, 0, 0, 1}},
39+
{:ipv6_v6only, true},
40+
{:port, 8081}
41+
])
3942
end
4043
end
4144

test/grpc/server/interceptors/logger_test.exs

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ defmodule GRPC.Server.Interceptors.LoggerTest do
6868
request = %FakeRequest{}
6969
stream = %Stream{server: @server_name, rpc: @rpc, request_id: nil}
7070
next = fn _stream, _request -> {:ok, :ok} end
71-
opts = LoggerInterceptor.init(level: :warn)
71+
opts = LoggerInterceptor.init(level: :warning)
7272

7373
logs =
7474
capture_log(fn ->
@@ -93,7 +93,7 @@ defmodule GRPC.Server.Interceptors.LoggerTest do
9393
end
9494

9595
test "calls next when below :logger level" do
96-
Logger.configure(level: :warn)
96+
Logger.configure(level: :warning)
9797

9898
request = %FakeRequest{}
9999
stream = %Stream{server: @server_name, rpc: @rpc, request_id: nil}

test/support/factory.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ defmodule GRPC.Factory do
4646
cacertfile: ca_path,
4747
keyfile: key_path,
4848
verify: :verify_none,
49-
versions: [:"tlsv1.2"]
49+
versions: [:"tlsv1.2", :"tlsv1.3"]
5050
]
5151
}
5252
end

0 commit comments

Comments
 (0)