Skip to content

Commit 509c526

Browse files
authored
Update Elixir requirement to 1.11+ (#316)
* Update Elixir requirement to 1.11+ * Update deps
1 parent 354204a commit 509c526

File tree

6 files changed

+56
-31
lines changed

6 files changed

+56
-31
lines changed

.github/workflows/tests.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,21 @@ jobs:
88
runs-on: ubuntu-20.04
99
strategy:
1010
matrix:
11-
otp: ['20.3']
12-
elixir: ['1.4', '1.5', '1.6', '1.7']
11+
include:
12+
- otp: '21.3'
13+
elixir: '1.11'
14+
- otp: '26.0'
15+
elixir: '1.15'
1316
env:
1417
MIX_ENV: test
1518
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1619
steps:
17-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v3
1821
- uses: erlef/setup-beam@v1
1922
with:
2023
otp-version: ${{ matrix.otp }}
2124
elixir-version: ${{ matrix.elixir }}
22-
- uses: actions/cache@v2
25+
- uses: actions/cache@v3
2326
with:
2427
path: deps
2528
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}

lib/excoveralls/cover.ex

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ defmodule ExCoveralls.Cover do
1414
{:ok, string_io} = StringIO.open("")
1515
Process.group_leader(pid, string_io)
1616

17-
:cover.compile_beam_directory(compile_path |> string_to_charlist)
17+
compile_path
18+
|> String.to_charlist()
19+
|> :cover.compile_beam_directory()
1820
end
1921

2022
@doc """
@@ -59,12 +61,6 @@ defmodule ExCoveralls.Cover do
5961
:cover.analyse(module, :calls, :line)
6062
end
6163

62-
if Version.compare(System.version, "1.3.0") == :lt do
63-
defp string_to_charlist(string), do: String.to_char_list(string)
64-
else
65-
defp string_to_charlist(string), do: String.to_charlist(string)
66-
end
67-
6864
defp file_exist?(module, path) do
6965
if File.exists?(path) do
7066
true

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ defmodule ExCoveralls.Mixfile do
77
[
88
app: :excoveralls,
99
version: "0.16.1",
10-
elixir: "~> 1.3",
10+
elixir: "~> 1.11",
1111
elixirc_paths: elixirc_paths(Mix.env()),
1212
deps: deps(),
1313
docs: docs(),

mix.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
%{
2-
"certifi": {:hex, :certifi, "2.5.2", "b7cfeae9d2ed395695dd8201c57a2d019c0c43ecaf8b8bcb9320b40d6662f340", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm", "3b3b5f36493004ac3455966991eaf6e768ce9884693d9968055aeeeb1e575040"},
2+
"certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"},
33
"earmark": {:hex, :earmark, "1.4.3", "364ca2e9710f6bff494117dbbd53880d84bebb692dafc3a78eb50aa3183f2bfd", [:mix], [], "hexpm", "8cf8a291ebf1c7b9539e3cddb19e9cef066c2441b1640f13c34c1d3cfc825fec"},
44
"earmark_parser": {:hex, :earmark_parser, "1.4.12", "b245e875ec0a311a342320da0551da407d9d2b65d98f7a9597ae078615af3449", [:mix], [], "hexpm", "711e2cc4d64abb7d566d43f54b78f7dc129308a63bc103fbd88550d2174b3160"},
55
"ex_doc": {:hex, :ex_doc, "0.23.0", "a069bc9b0bf8efe323ecde8c0d62afc13d308b1fa3d228b65bca5cf8703a529d", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "f5e2c4702468b2fd11b10d39416ddadd2fcdd173ba2a0285ebd92c39827a5a16"},
6-
"hackney": {:hex, :hackney, "1.16.0", "5096ac8e823e3a441477b2d187e30dd3fff1a82991a806b2003845ce72ce2d84", [:rebar3], [{:certifi, "2.5.2", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.1", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.0", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.6", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm", "3bf0bebbd5d3092a3543b783bf065165fa5d3ad4b899b836810e513064134e18"},
7-
"idna": {:hex, :idna, "6.0.1", "1d038fb2e7668ce41fbf681d2c45902e52b3cb9e9c77b55334353b222c2ee50c", [:rebar3], [{:unicode_util_compat, "0.5.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a02c8a1c4fd601215bb0b0324c8a6986749f807ce35f25449ec9e69758708122"},
6+
"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"},
7+
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
88
"jason": {:hex, :jason, "1.1.1", "d3ccb840dfb06f2f90a6d335b536dd074db748b3e7f5b11ab61d239506585eb2", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "639645cfac325e34938167b272bae0791fea3a34cf32c29525abf1d323ed4c18"},
99
"makeup": {:hex, :makeup, "1.0.5", "d5a830bc42c9800ce07dd97fa94669dfb93d3bf5fcf6ea7a0c67b2e0e4a7f26c", [:mix], [{:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cfa158c02d3f5c0c665d0af11512fed3fba0144cf1aadee0f2ce17747fba2ca9"},
1010
"makeup_elixir": {:hex, :makeup_elixir, "0.15.0", "98312c9f0d3730fde4049985a1105da5155bfe5c11e47bdc7406d88e01e4219b", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "75ffa34ab1056b7e24844c90bfc62aaf6f3a37a15faa76b07bc5eba27e4a8b4a"},
@@ -13,9 +13,9 @@
1313
"mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},
1414
"mock": {:hex, :mock, "0.3.6", "e810a91fabc7adf63ab5fdbec5d9d3b492413b8cda5131a2a8aa34b4185eb9b4", [:mix], [{:meck, "~> 0.8.13", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm", "bcf1d0a6826fb5aee01bae3d74474669a3fa8b2df274d094af54a25266a1ebd2"},
1515
"nimble_parsec": {:hex, :nimble_parsec, "1.1.0", "3a6fca1550363552e54c216debb6a9e95bd8d32348938e13de5eda962c0d7f89", [:mix], [], "hexpm", "08eb32d66b706e913ff748f11694b17981c0b04a33ef470e33e11b3d3ac8f54b"},
16-
"parse_trans": {:hex, :parse_trans, "3.3.0", "09765507a3c7590a784615cfd421d101aec25098d50b89d7aa1d66646bc571c1", [:rebar3], [], "hexpm", "17ef63abde837ad30680ea7f857dd9e7ced9476cdd7b0394432af4bfc241b960"},
16+
"parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"},
1717
"sax_map": {:hex, :sax_map, "1.0.1", "51a9382d741504c34d49118fb36d691c303d042e1da88f8edae8ebe75fe74435", [:mix], [{:saxy, "~> 1.0", [hex: :saxy, repo: "hexpm", optional: false]}], "hexpm", "a7c57c25d23bfc3ce93cf93400dcfb447fe463d27ee8c6913545161e78dc487a"},
1818
"saxy": {:hex, :saxy, "0.10.0", "38879f46a595862c22114792c71379355ecfcfa0f713b1cfcc59e1d4127f1f55", [:mix], [], "hexpm", "da130ed576e9f53d1a986ec5bd2fa72c1599501ede7d7a2dceb81acf53bf9790"},
19-
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
20-
"unicode_util_compat": {:hex, :unicode_util_compat, "0.5.0", "8516502659002cec19e244ebd90d312183064be95025a319a6c7e89f4bccd65b", [:rebar3], [], "hexpm", "d48d002e15f5cc105a696cf2f1bbb3fc72b4b770a184d8420c8db20da2674b38"},
19+
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"},
20+
"unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"},
2121
}

test/json_test.exs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ defmodule ExCoveralls.JsonTest do
3434
File.rm!(path)
3535
File.rmdir!(@test_output_dir)
3636
end
37-
37+
3838
ExCoveralls.ConfServer.clear()
3939
end
4040

@@ -53,7 +53,16 @@ defmodule ExCoveralls.JsonTest do
5353
Json.execute(@source_info)
5454
end) =~ @stats_result
5555

56-
assert(File.read!(report) =~ ~s({"source_files":[{"coverage":[0,1,null,null],"name":"test/fixtures/test.ex","source":"defmodule Test do\\n def test do\\n end\\nend\\n"}]}))
56+
assert(
57+
%{
58+
"source_files" => [
59+
%{
60+
"coverage" => [0, 1, nil, nil],
61+
"name" => "test/fixtures/test.ex",
62+
"source" => "defmodule Test do\n def test do\n end\nend\n"
63+
}
64+
]
65+
} = Jason.decode!(File.read!(report)))
5766
%{size: size} = File.stat! report
5867
assert(size == @file_size)
5968
end
@@ -63,7 +72,16 @@ defmodule ExCoveralls.JsonTest do
6372
Json.execute(@source_info, [output_dir: @test_output_dir])
6473
end) =~ @stats_result
6574

66-
assert(File.read!(report) =~ ~s({"source_files":[{"coverage":[0,1,null,null],"name":"test/fixtures/test.ex","source":"defmodule Test do\\n def test do\\n end\\nend\\n"}]}))
75+
assert(
76+
%{
77+
"source_files" => [
78+
%{
79+
"coverage" => [0, 1, nil, nil],
80+
"name" => "test/fixtures/test.ex",
81+
"source" => "defmodule Test do\n def test do\n end\nend\n"
82+
}
83+
]
84+
} = Jason.decode!(File.read!(report)))
6785
%{size: size} = File.stat! report
6886
assert(size == @file_size)
6987
end

test/post_test.exs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,23 @@ defmodule ExCoveralls.PostTest do
3434
flagname: "arbitrary_value"
3535
])
3636

37-
assert json ==
38-
"{\"flag_name\":\"arbitrary_value\",\"git\":{\"branch\":\"\",\"head\":{\"committer_name\":\"\",\"id\":\"\",\"message\":\"\"}}," <>
39-
"\"parallel\":null," <>
40-
"\"repo_token\":\"1234567890\"," <>
41-
"\"service_name\":\"local\"," <>
42-
"\"service_number\":\"build_num_1\"," <>
43-
"\"source_files\":" <>
44-
"[{\"coverage\":[0,1,null,null]," <>
45-
"\"name\":\"test/fixtures/test.ex\"," <>
46-
"\"source\":\"defmodule Test do\\n def test do\\n end\\nend\\n\"}]}"
37+
assert Jason.decode!(json) == %{
38+
"flag_name" => "arbitrary_value",
39+
"git" => %{
40+
"branch" => "",
41+
"head" => %{"committer_name" => "", "id" => "", "message" => ""}
42+
},
43+
"parallel" => nil,
44+
"repo_token" => "1234567890",
45+
"service_name" => "local",
46+
"service_number" => "build_num_1",
47+
"source_files" => [
48+
%{
49+
"coverage" => [0, 1, nil, nil],
50+
"name" => "test/fixtures/test.ex",
51+
"source" => "defmodule Test do\n def test do\n end\nend\n"
52+
}
53+
]
54+
}
4755
end
4856
end

0 commit comments

Comments
 (0)