Skip to content

Commit a5335b1

Browse files
authored
chore: 0.19 release (#67)
* Bump deps and version * Fix and remove logging in tests * Bump Elixir and OTP build matrix * Bump Elixir and Erlang
1 parent 61c3c1b commit a5335b1

File tree

6 files changed

+67
-69
lines changed

6 files changed

+67
-69
lines changed

.github/workflows/main.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@ on:
99
jobs:
1010
build:
1111
name: Build and test
12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-24.04
1313

1414
strategy:
1515
matrix:
16-
elixir: ["1.12", "1.13", "1.14"]
17-
otp: ["23", "24", "25"]
16+
elixir: ['1.16', '1.17', '1.18']
17+
otp: ['25', '26', '27']
1818
exclude:
19-
- elixir: 1.12
20-
otp: 25
21-
- elixir: 1.13
22-
otp: 25
19+
- elixir: 1.16
20+
otp: 27
2321

2422
steps:
2523
- uses: actions/checkout@v2

.github/workflows/release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release workflow
33
on:
44
push:
55
tags:
6-
- "*"
6+
- '*'
77

88
jobs:
99
build:
@@ -12,8 +12,8 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
elixir: ["1.14"]
16-
otp: ["25"]
15+
elixir: ['1.17']
16+
otp: ['27']
1717

1818
steps:
1919
- uses: actions/checkout@v2

.tool-versions

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
elixir 1.14
2-
erlang 25.3
1+
elixir 1.18.2
2+
erlang 27.2

mix.exs

+26-19
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,13 @@ defmodule Retry.Mixfile do
77
name: "retry",
88
description:
99
"Simple Elixir macros for linear retry, exponential backoff and wait with composable delays.",
10-
version: "0.18.0",
11-
elixir: "~> 1.12",
12-
source_url: "https://github.com/safwank/ElixirRetry",
13-
docs: [
14-
extras: ["README.md"],
15-
source_ref: "master"
16-
],
17-
build_embedded: Mix.env() == :prod,
10+
version: "0.19.0",
11+
elixir: "~> 1.16",
1812
start_permanent: Mix.env() == :prod,
1913
deps: deps(),
2014
package: package(),
15+
docs: docs(),
16+
dialyzer: dialyzer(),
2117
test_coverage: [tool: ExCoveralls],
2218
preferred_cli_env: [
2319
credo: :test,
@@ -31,25 +27,36 @@ defmodule Retry.Mixfile do
3127
]
3228
end
3329

34-
def application do
35-
[applications: [:logger]]
36-
end
37-
3830
defp deps do
3931
[
40-
{:credo, "~> 1.7.0", only: :test},
41-
{:excoveralls, "~> 0.16.0", only: :test},
42-
{:dialyxir, "~> 1.3.0", only: [:dev, :test]},
43-
{:ex_doc, "~> 0.29.0", only: :dev},
44-
{:earmark, "~> 1.4.0", only: :dev}
32+
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
33+
{:excoveralls, "~> 0.18", only: :test},
34+
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
35+
{:ex_doc, "~> 0.37", only: :dev, runtime: false},
36+
{:earmark, "~> 1.4", only: :dev, runtime: false}
4537
]
4638
end
4739

4840
defp package do
4941
[
5042
maintainers: ["Safwan Kamarrudin"],
51-
licenses: ["Apache 2.0"],
52-
links: %{github: "https://github.com/safwank/ElixirRetry"}
43+
licenses: ["Apache-2.0"],
44+
links: %{"GitHub" => "https://github.com/safwank/ElixirRetry"}
45+
]
46+
end
47+
48+
defp docs do
49+
[
50+
main: "readme",
51+
extras: ["README.md"],
52+
source_url: "https://github.com/safwank/ElixirRetry",
53+
source_ref: "master"
54+
]
55+
end
56+
57+
defp dialyzer do
58+
[
59+
plt_add_apps: [:ex_unit, :mix],
5360
]
5461
end
5562
end

mix.lock

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
%{
2-
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
2+
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
33
"certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"},
4-
"credo": {:hex, :credo, "1.7.0", "6119bee47272e85995598ee04f2ebbed3e947678dee048d10b5feca139435f75", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "6839fcf63d1f0d1c0f450abc8564a57c43d644077ab96f2934563e68b8a769d7"},
5-
"dialyxir": {:hex, :dialyxir, "1.3.0", "fd1672f0922b7648ff9ce7b1b26fcf0ef56dda964a459892ad15f6b4410b5284", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "00b2a4bcd6aa8db9dcb0b38c1225b7277dca9bc370b6438715667071a304696f"},
6-
"earmark": {:hex, :earmark, "1.4.37", "56ce845c543393aa3f9b294c818c3d783452a4a67e4ab18c4303a954a8b59363", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}], "hexpm", "d86d5e12868db86d5321b00e62a4bbcb4150346e4acc9a90a041fb188a5cb106"},
7-
"earmark_parser": {:hex, :earmark_parser, "1.4.31", "a93921cdc6b9b869f519213d5bc79d9e218ba768d7270d46fdcf1c01bacff9e2", [:mix], [], "hexpm", "317d367ee0335ef037a87e46c91a2269fef6306413f731e8ec11fc45a7efd059"},
8-
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
9-
"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"},
10-
"excoveralls": {:hex, :excoveralls, "0.16.1", "0bd42ed05c7d2f4d180331a20113ec537be509da31fed5c8f7047ce59ee5a7c5", [:mix], [{:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "dae763468e2008cf7075a64cb1249c97cb4bc71e236c5c2b5e5cdf1cfa2bf138"},
4+
"credo": {:hex, :credo, "1.7.7", "771445037228f763f9b2afd612b6aa2fd8e28432a95dbbc60d8e03ce71ba4446", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "8bc87496c9aaacdc3f90f01b7b0582467b69b4bd2441fe8aae3109d843cc2f2e"},
5+
"dialyxir": {:hex, :dialyxir, "1.4.4", "fb3ce8741edeaea59c9ae84d5cec75da00fa89fe401c72d6e047d11a61f65f70", [:mix], [{:erlex, ">= 0.2.7", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "cd6111e8017ccd563e65621a4d9a4a1c5cd333df30cebc7face8029cacb4eff6"},
6+
"earmark": {:hex, :earmark, "1.4.47", "7e7596b84fe4ebeb8751e14cbaeaf4d7a0237708f2ce43630cfd9065551f94ca", [:mix], [], "hexpm", "3e96bebea2c2d95f3b346a7ff22285bc68a99fbabdad9b655aa9c6be06c698f8"},
7+
"earmark_parser": {:hex, :earmark_parser, "1.4.43", "34b2f401fe473080e39ff2b90feb8ddfeef7639f8ee0bbf71bb41911831d77c5", [:mix], [], "hexpm", "970a3cd19503f5e8e527a190662be2cee5d98eed1ff72ed9b3d1a3d466692de8"},
8+
"erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"},
9+
"ex_doc": {:hex, :ex_doc, "0.37.2", "2a3aa7014094f0e4e286a82aa5194a34dd17057160988b8509b15aa6c292720c", [:mix], [{:earmark_parser, "~> 1.4.42", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "4dfa56075ce4887e4e8b1dcc121cd5fcb0f02b00391fd367ff5336d98fa49049"},
10+
"excoveralls": {:hex, :excoveralls, "0.18.3", "bca47a24d69a3179951f51f1db6d3ed63bca9017f476fe520eb78602d45f7756", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "746f404fcd09d5029f1b211739afb8fb8575d775b21f6a3908e7ce3e640724c6"},
1111
"exjsx": {:hex, :exjsx, "4.0.0", "60548841e0212df401e38e63c0078ec57b33e7ea49b032c796ccad8cde794b5c", [:mix], [{:jsx, "~> 2.8.0", [hex: :jsx, repo: "hexpm", optional: false]}], "hexpm"},
12-
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
12+
"file_system": {:hex, :file_system, "1.0.1", "79e8ceaddb0416f8b8cd02a0127bdbababe7bf4a23d2a395b983c1f8b3f73edd", [:mix], [], "hexpm", "4414d1f38863ddf9120720cd976fce5bdde8e91d8283353f0e31850fa89feb9e"},
1313
"hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~> 2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"},
1414
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
15-
"jason": {:hex, :jason, "1.4.0", "e855647bc964a44e2f67df589ccf49105ae039d4179db7f6271dfd3843dc27e6", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "79a3791085b2a0f743ca04cec0f7be26443738779d09302e01318f97bdb82121"},
15+
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
1616
"jsx": {:hex, :jsx, "2.8.3", "a05252d381885240744d955fbe3cf810504eb2567164824e19303ea59eef62cf", [:mix, :rebar3], [], "hexpm"},
17-
"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"},
18-
"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"},
19-
"makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"},
17+
"makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"},
18+
"makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [: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", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"},
19+
"makeup_erlang": {:hex, :makeup_erlang, "1.0.2", "03e1804074b3aa64d5fad7aa64601ed0fb395337b982d9bcf04029d68d51b6a7", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "af33ff7ef368d5893e4a267933e7744e46ce3cf1f61e2dccf53a111ed3aa3727"},
2020
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
2121
"mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},
22-
"nimble_parsec": {:hex, :nimble_parsec, "1.3.0", "9e18a119d9efc3370a3ef2a937bf0b24c088d9c4bf0ba9d7c3751d49d347d035", [:mix], [], "hexpm", "7977f183127a7cbe9346981e2f480dc04c55ffddaef746bd58debd566070eef8"},
22+
"nimble_parsec": {:hex, :nimble_parsec, "1.4.2", "8efba0122db06df95bfaa78f791344a89352ba04baedd3849593bfce4d0dc1c6", [:mix], [], "hexpm", "4b21398942dda052b403bbe1da991ccd03a053668d147d53fb8c4e0efe09c973"},
2323
"parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"},
2424
"poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm"},
2525
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},

test/retry_test.exs

+17-24
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ defmodule RetryTest do
33
use Retry
44

55
import Stream
6-
import ExUnit.CaptureLog
76
require Logger
87

98
doctest Retry
@@ -88,19 +87,16 @@ defmodule RetryTest do
8887
end
8988

9089
test "does not retry on :error if atoms is specified" do
91-
f = fn ->
90+
result =
9291
retry with: linear_backoff(50, 1) |> take(5), atoms: :not_ok do
93-
Logger.info("running")
9492
:error
9593
after
9694
result -> result
9795
else
9896
_error -> :not_this
9997
end
100-
end
10198

102-
assert f.() == :error
103-
assert Regex.scan(~r/running/, capture_log(f)) |> length == 1
99+
assert result == :error
104100
end
105101

106102
test "retries execution for specified attempts when error is raised" do
@@ -167,36 +163,33 @@ defmodule RetryTest do
167163
end
168164

169165
test "does not retry on RuntimeError if some other rescue_only is specified" do
170-
f = fn ->
171-
assert_raise RuntimeError, fn ->
172-
retry with: linear_backoff(50, 1) |> take(5), rescue_only: CustomError do
173-
Logger.info("running")
174-
raise RuntimeError
175-
after
176-
_ -> :ok
177-
else
178-
error -> raise error
166+
{elapsed, _} =
167+
:timer.tc(fn ->
168+
assert_raise RuntimeError, fn ->
169+
retry with: linear_backoff(50, 1) |> take(5), rescue_only: CustomError do
170+
raise RuntimeError
171+
after
172+
_ -> :ok
173+
else
174+
error -> raise error
175+
end
179176
end
180-
end
181-
end
177+
end)
182178

183-
assert Regex.scan(~r/running/, capture_log(f)) |> length == 1
179+
assert elapsed / 1_000 < 250
184180
end
185181

186182
test "does not have to retry execution when there is no error" do
187-
f = fn ->
183+
result =
188184
retry with: linear_backoff(50, 1) |> take(5) do
189-
Logger.info("running")
190185
{:ok, "Everything's so awesome!"}
191186
after
192187
result -> result
193188
else
194189
_ -> :error
195190
end
196-
end
197191

198-
assert f.() == {:ok, "Everything's so awesome!"}
199-
assert Regex.scan(~r/running/, capture_log(f)) |> length == 1
192+
assert result == {:ok, "Everything's so awesome!"}
200193
end
201194

202195
test "uses the default 'after' action" do
@@ -341,7 +334,7 @@ defmodule RetryTest do
341334
end
342335

343336
test "responds with a meaningful error when clauses are not given" do
344-
assert_raise CompileError, ~r/expected -> clauses for :do in "case"$/, fn ->
337+
assert_raise CompileError, ~r/cannot compile module/, fn ->
345338
defmodule BadRetryWhileSyntax do
346339
def retry_while do
347340
retry_while with: linear_backoff(50, 1) |> take(5), acc: 0 do

0 commit comments

Comments
 (0)