diff --git a/.github/workflows/run_test_case.yaml b/.github/workflows/run_test_case.yaml index 485e1e2..a676000 100644 --- a/.github/workflows/run_test_case.yaml +++ b/.github/workflows/run_test_case.yaml @@ -11,9 +11,16 @@ on: jobs: run_test_case: runs-on: ubuntu-latest - + strategy: + matrix: + otp: + - vsn: "26.2.1-2" + builder: "5.3-5:1.15.7-26.2.1-2-ubuntu24.04" + - vsn: "27.2-1" + builder: "5.4-3:1.17.3-27.2-1-ubuntu24.04" + container: - image: ghcr.io/emqx/emqx-builder/5.3-5:1.15.7-26.2.1-2-ubuntu24.04 + image: "ghcr.io/emqx/emqx-builder/${{ matrix.otp.builder }}" steps: - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 @@ -28,6 +35,7 @@ jobs: make eunit make ct make cover + - name: Coveralls env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -36,9 +44,9 @@ jobs: - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 if: always() with: - name: logs + name: "logs-${{ matrix.otp.vsn }}" path: _build/test/logs - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: - name: cover + name: "cover-${{ matrix.otp.vsn }}" path: _build/test/cover diff --git a/rebar.config b/rebar.config index 456a523..a4dbfc1 100644 --- a/rebar.config +++ b/rebar.config @@ -1,9 +1,9 @@ %% -*- mode:erlang -*- {minimum_otp_vsn, "21.0"}. -{deps, [{jiffy, {git, "https://github.com/emqx/jiffy", {tag, "1.0.5"}}}, - {eetcd, {git, "https://github.com/zhongwencool/eetcd", {tag, "v0.3.4"}}}, - {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe", {tag, "1.0.0"}}}, +{deps, [{jsone, "1.9.0"}, + {eetcd, {git, "https://github.com/zhongwencool/eetcd", {tag, "v0.5.0"}}}, + {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe", {tag, "1.0.10"}}}, {mria, {git, "https://github.com/emqx/mria", {tag, "0.8.11"}}} ]}. @@ -31,13 +31,13 @@ {dialyzer, [{warnings, [unknown]}, - {plt_extra_apps, [jiffy, mria]} + {plt_extra_apps, [mria]} ]}. {profiles, [{test, [{plugins, [{coveralls, {git, "https://github.com/emqx/coveralls-erl", {branch, "github"}}}]}, - {deps, [{meck, "0.8.13"}, + {deps, [{meck, "1.0.0"}, {proper, "1.3.0"} ]}, {erl_opts, [debug_info]}, diff --git a/src/ekka.app.src b/src/ekka.app.src index 7836c87..e5ec25c 100644 --- a/src/ekka.app.src +++ b/src/ekka.app.src @@ -11,6 +11,7 @@ stdlib, inets, eetcd, + jsone, snabbkaffe, mria ]}, diff --git a/src/ekka_cluster_etcd.erl b/src/ekka_cluster_etcd.erl index 77360b6..6c00f15 100644 --- a/src/ekka_cluster_etcd.erl +++ b/src/ekka_cluster_etcd.erl @@ -343,9 +343,9 @@ init(Options) -> Servers = proplists:get_value(server, Options, []), Prefix = proplists:get_value(prefix, Options), Hosts = [remove_scheme(Server) || Server <- Servers], - {Transport, TransportOpts} = case ssl_options(Options) of - [] -> {tcp, []}; - [SSL] -> SSL + TransportOpts = case ssl_options(Options) of + [] -> [{transport, tcp}]; + [{ssl, TLSOpts}] -> [{transport, tls}, {tls_opts, TLSOpts}] end, %% At the time of writing, the etcd connection process does not %% close when this process dies. So, when this processes is @@ -354,7 +354,7 @@ init(Options) -> %% that no connection with this name exists before opening it %% (again). eetcd:close(?MODULE), - {ok, _Pid} = eetcd:open(?MODULE, Hosts, Transport, TransportOpts), + {ok, _Pid} = eetcd:open(?MODULE, Hosts, TransportOpts), {ok, #{'ID' := ID}} = eetcd_lease:grant(?MODULE, 5), {ok, Pid2} = eetcd_lease:keep_alive(?MODULE, ID), true = link(Pid2), diff --git a/src/ekka_httpc.erl b/src/ekka_httpc.erl index 933ade1..477b19a 100644 --- a/src/ekka_httpc.erl +++ b/src/ekka_httpc.erl @@ -99,9 +99,9 @@ parse_response({ok, {{_, Code, _}, _Headers, Body}}) -> parse_response({ok, {Code, Body}}) -> parse_response({ok, Code, Body}); parse_response({ok, 200, Body}) -> - {ok, jiffy:decode(iolist_to_binary(Body), [return_maps])}; + {ok, jsone:decode(iolist_to_binary(Body))}; parse_response({ok, 201, Body}) -> - {ok, jiffy:decode(iolist_to_binary(Body), [return_maps])}; + {ok, jsone:decode(iolist_to_binary(Body))}; parse_response({ok, 204, _Body}) -> {ok, []}; parse_response({ok, Code, Body}) -> diff --git a/test/mod_etcd.erl b/test/mod_etcd.erl index b1ba0bd..959eb59 100644 --- a/test/mod_etcd.erl +++ b/test/mod_etcd.erl @@ -30,7 +30,7 @@ do(_Req = #mod{method = "GET", request_uri = "/v2/keys/" ++ _Uri}) -> Nodes) } }, - Response = {200, binary_to_list(jiffy:encode(Body))}, + Response = {200, binary_to_list(jsone:encode(Body))}, {proceed, [{response, Response}]}; do(_Req = #mod{request_uri = "/v2/keys/" ++ _Uri}) -> {proceed, [{response, {200, "{\"errorCode\": 0}"}}]};