Skip to content

Commit 85d11e5

Browse files
author
Brujo Benavides
authored
[RTI-9583] Adjust for OTP23 (#70)
1 parent b737924 commit 85d11e5

10 files changed

Lines changed: 46 additions & 44 deletions

rebar.config

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@
3535
deprecated_function_calls,
3636
deprecated_functions]}.
3737

38-
{profiles, [{test, [{deps, [{proc, "1.1.0"}, {meck, "0.9.1"}]}]}]}.
38+
{profiles, [{test, [{deps, [{proc, "1.1.1"}, {meck, "0.9.2"}]}]}]}.
3939

4040
{alias, [{test, [format, lint, hank, xref, dialyzer, eunit, cover]}]}.
4141

4242
{project_plugins,
43-
[{rebar3_hex, "~> 6.11.0"},
44-
{rebar3_format, "~> 1.0.0"},
43+
[{rebar3_hex, "~> 6.11.4"},
44+
{rebar3_format, "~> 1.0.1"},
4545
{rebar3_lint, "~> 0.4.0"},
46-
{rebar3_hank, "~> 0.4.0"}]}.
46+
{rebar3_hank, "~> 1.1.2"}]}.

test/mero_SUITE.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030

3131
-author('Miriam Pena <miriam.pena@adroll.com>').
3232

33+
-behaviour(ct_suite).
34+
3335
-include_lib("eunit/include/eunit.hrl").
3436
-include_lib("common_test/include/ct.hrl").
3537

test/mero_cluster_SUITE.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030

3131
-author('Miriam Pena <miriam.pena@adroll.com>').
3232

33-
-include_lib("common_test/include/ct.hrl").
33+
-behaviour(ct_suite).
34+
3435
-include_lib("eunit/include/eunit.hrl").
3536

3637
-export([all/0, load_cluster/1, shard_phash2/1, shard_crc32/1, select_pool/1,

test/mero_conf_SUITE.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030

3131
-author('Miriam Pena <miriam.pena@adroll.com>').
3232

33-
-include_lib("common_test/include/ct.hrl").
33+
-behaviour(ct_suite).
34+
3435
-include_lib("eunit/include/eunit.hrl").
3536

3637
-export([all/0, init_per_testcase/2, end_per_testcase/2, helper_mfa_config_function/0,

test/mero_conf_monitor_SUITE.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
%%
2929
-module(mero_conf_monitor_SUITE).
3030

31-
-include_lib("common_test/include/ct.hrl").
31+
-behaviour(ct_suite).
32+
3233
-include_lib("eunit/include/eunit.hrl").
3334

3435
-export([all/0, init_per_testcase/2, end_per_testcase/2]).

test/mero_dummy_server.erl

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
-module(mero_dummy_server).
3030

3131
-include_lib("mero/include/mero.hrl").
32-
-include_lib("eunit/include/eunit.hrl").
3332

3433
-author('Miriam Pena <miriam.pena@adroll.com>').
3534

@@ -248,23 +247,23 @@ parse(Request) ->
248247

249248
%%%% Response
250249

251-
canned_responses(text, _Index, _Key, _Op, not_found) ->
250+
canned_responses(text, _Index, _Op, not_found) ->
252251
["NOT_FOUND", <<"\r\n">>];
253-
canned_responses(text, _Index, _Key, _Op, not_stored) ->
252+
canned_responses(text, _Index, _Op, not_stored) ->
254253
["NOT_STORED", <<"\r\n">>];
255-
canned_responses(text, _Index, _Key, _Op, stored) ->
254+
canned_responses(text, _Index, _Op, stored) ->
256255
[<<"STORED">>, <<"\r\n">>];
257-
canned_responses(text, _Index, _Key, _Op, already_exists) ->
256+
canned_responses(text, _Index, _Op, already_exists) ->
258257
[<<"EXISTS">>, <<"\r\n">>];
259-
canned_responses(text, _Index, _Key, _Op, deleted) ->
258+
canned_responses(text, _Index, _Op, deleted) ->
260259
[<<"DELETED">>, <<"\r\n">>];
261-
canned_responses(text, _Index, _Key, _Op, flushed) ->
260+
canned_responses(text, _Index, _Op, flushed) ->
262261
[<<"FLUSHED">>, <<"\r\n">>];
263-
canned_responses(text, _Index, _Key, _Op, {incr, I}) ->
262+
canned_responses(text, _Index, _Op, {incr, I}) ->
264263
[mero_util:to_bin(I), <<"\r\n">>];
265-
canned_responses(text, _Index, _Key, _Op, noop) ->
264+
canned_responses(text, _Index, _Op, noop) ->
266265
[];
267-
canned_responses(binary, Index, _Key, Op, not_found) ->
266+
canned_responses(binary, Index, Op, not_found) ->
268267
ExtrasOut = <<>>,
269268
ExtrasSizeOut = size(ExtrasOut),
270269
Status = ?NOT_FOUND,
@@ -281,7 +280,7 @@ canned_responses(binary, Index, _Key, Op, not_found) ->
281280
(opaque(Index)):32,
282281
0:64,
283282
BodyOut/binary>>;
284-
canned_responses(binary, Index, _Key, Op, not_stored) ->
283+
canned_responses(binary, Index, Op, not_stored) ->
285284
ExtrasOut = <<>>,
286285
ExtrasSizeOut = size(ExtrasOut),
287286
Status = ?NOT_STORED,
@@ -299,7 +298,7 @@ canned_responses(binary, Index, _Key, Op, not_stored) ->
299298
(opaque(Index)):32,
300299
0:64,
301300
BodyOut/binary>>;
302-
canned_responses(binary, Index, _Key, Op, stored) ->
301+
canned_responses(binary, Index, Op, stored) ->
303302
ExtrasOut = <<>>,
304303
ExtrasSizeOut = size(ExtrasOut),
305304
Status = ?NO_ERROR,
@@ -319,7 +318,6 @@ canned_responses(binary, Index, _Key, Op, stored) ->
319318
BodyOut/binary>>;
320319
canned_responses(binary,
321320
Index,
322-
_Key,
323321
Op,
324322
deleted) -> %% same as stored, intentionally
325323
ExtrasOut = <<>>,
@@ -339,7 +337,7 @@ canned_responses(binary,
339337
(opaque(Index)):32,
340338
0:64,
341339
BodyOut/binary>>;
342-
canned_responses(binary, Index, _Key, ?MEMCACHE_INCREMENT, {incr, I}) ->
340+
canned_responses(binary, Index, ?MEMCACHE_INCREMENT, {incr, I}) ->
343341
ExtrasOut = <<>>,
344342
ExtrasSizeOut = size(ExtrasOut),
345343
Status = ?NO_ERROR,
@@ -357,7 +355,7 @@ canned_responses(binary, Index, _Key, ?MEMCACHE_INCREMENT, {incr, I}) ->
357355
(opaque(Index)):32,
358356
0:64,
359357
BodyOut/binary>>;
360-
canned_responses(binary, Index, _Key, Op, already_exists) ->
358+
canned_responses(binary, Index, Op, already_exists) ->
361359
ExtrasOut = <<>>,
362360
ExtrasSizeOut = size(ExtrasOut),
363361
Status = ?KEY_EXISTS,
@@ -375,7 +373,7 @@ canned_responses(binary, Index, _Key, Op, already_exists) ->
375373
(opaque(Index)):32,
376374
0:64,
377375
BodyOut/binary>>;
378-
canned_responses(binary, _Index, _Key, Op, flushed) ->
376+
canned_responses(binary, _Index, Op, flushed) ->
379377
ExtrasOut = <<>>,
380378
ExtrasSizeOut = size(ExtrasOut),
381379
Status = ?NO_ERROR,
@@ -393,7 +391,7 @@ canned_responses(binary, _Index, _Key, Op, flushed) ->
393391
16#00:32,
394392
0:64,
395393
BodyOut/binary>>;
396-
canned_responses(binary, _Index, _Key, _Op, noop) ->
394+
canned_responses(binary, _Index, _Op, noop) ->
397395
[].
398396

399397
opaque(undefined) ->
@@ -479,7 +477,7 @@ response(Parent, Port, Request) ->
479477
case {Kind, Cmd} of
480478
{Kind, flush_all} ->
481479
flush_all(Parent, Port),
482-
canned_responses(Kind, undefined, undefined, ?MEMCACHE_FLUSH_ALL, flushed);
480+
canned_responses(Kind, undefined, ?MEMCACHE_FLUSH_ALL, flushed);
483481
{Kind, {get, Keys}} ->
484482
case Kind of
485483
text ->
@@ -501,7 +499,7 @@ response(Parent, Port, Request) ->
501499
<<>>;
502500
{Kind, {set, Key, Bytes, Index, false}} ->
503501
put_key(Parent, Port, Key, Bytes),
504-
canned_responses(Kind, Index, Key, ?MEMCACHE_SET, stored);
502+
canned_responses(Kind, Index, ?MEMCACHE_SET, stored);
505503
{Kind, {cas, Key, Bytes, CAS, Index, Quiet}} ->
506504
Op = case Quiet of
507505
true ->
@@ -512,31 +510,31 @@ response(Parent, Port, Request) ->
512510
case get_key(Parent, Port, Key) of
513511
undefined ->
514512
ct:log("cas of non-existent key ~p", [Key]),
515-
canned_responses(Kind, Index, Key, Op, not_found);
513+
canned_responses(Kind, Index, Op, not_found);
516514
{_, CAS} ->
517515
ct:log("cas of existing key ~p with correct token ~p", [Key, CAS]),
518516
put_key(Parent, Port, Key, Bytes, CAS + 1),
519517
case Quiet of
520518
true ->
521519
<<>>;
522520
false ->
523-
canned_responses(Kind, Index, Key, Op, stored)
521+
canned_responses(Kind, Index, Op, stored)
524522
end;
525523
{_, ExpectedCAS} ->
526524
ct:log("cas of existing key ~p with incorrect token ~p (wanted ~p)",
527525
[Key, CAS, ExpectedCAS]),
528-
canned_responses(Kind, Index, Key, Op, already_exists)
526+
canned_responses(Kind, Index, Op, already_exists)
529527
end;
530528
{Kind, {delete, Key}} ->
531529
ct:log("deleting ~p", [Key]),
532530
case get_key(Parent, Port, Key) of
533531
undefined ->
534532
ct:log("was not present"),
535-
canned_responses(Kind, undefined, Key, ?MEMCACHE_DELETE, not_found);
533+
canned_responses(Kind, undefined, ?MEMCACHE_DELETE, not_found);
536534
{_Value, _} ->
537535
ct:log("key was present"),
538536
put_key(Parent, Port, Key, undefined, undefined),
539-
canned_responses(Kind, undefined, Key, ?MEMCACHE_DELETE, deleted)
537+
canned_responses(Kind, undefined, ?MEMCACHE_DELETE, deleted)
540538
end;
541539
{Kind, {add, Key, Bytes, Index, Quiet}} ->
542540
Op = case Quiet of
@@ -552,34 +550,29 @@ response(Parent, Port, Request) ->
552550
true ->
553551
<<>>;
554552
false ->
555-
canned_responses(Kind, Index, Key, Op, stored)
553+
canned_responses(Kind, Index, Op, stored)
556554
end;
557555
{_Value, _} ->
558-
canned_responses(Kind, Index, Key, Op, already_exists)
556+
canned_responses(Kind, Index, Op, already_exists)
559557
end;
560558
{Kind, {incr, Key, ExpTime, Initial, Bytes}} ->
561559
case get_key(Parent, Port, Key) of
562560
undefined ->
563561
%% Return error
564562
case ExpTime of
565563
4294967295 -> %% 32 bits, all 1
566-
canned_responses(Kind,
567-
undefined,
568-
Key,
569-
?MEMCACHE_INCREMENT,
570-
not_found);
564+
canned_responses(Kind, undefined, ?MEMCACHE_INCREMENT, not_found);
571565
_ ->
572566
put_key(Parent, Port, Key, Initial),
573567
canned_responses(Kind,
574568
undefined,
575-
Key,
576569
?MEMCACHE_INCREMENT,
577570
{incr, Initial})
578571
end;
579572
{Value, _} ->
580573
Result = mero_util:to_int(Value) + mero_util:to_int(Bytes),
581574
put_key(Parent, Port, Key, Result),
582-
canned_responses(Kind, undefined, Key, ?MEMCACHE_INCREMENT, {incr, Result})
575+
canned_responses(Kind, undefined, ?MEMCACHE_INCREMENT, {incr, Result})
583576
end
584577
end,
585578
{Response, Unparsed}.

test/mero_pool_SUITE.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030

3131
-author('Miriam Pena <miriam.pena@adroll.com>').
3232

33-
-include_lib("common_test/include/ct.hrl").
33+
-behaviour(ct_suite).
34+
3435
-include_lib("eunit/include/eunit.hrl").
3536

3637
-export([all/0, init_per_testcase/2, end_per_testcase/2, start_stop/1, start_stop_many/1,

test/mero_test_with_local_memcached_SUITE.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030

3131
-author('Miriam Pena <miriam.pena@adroll.com>').
3232

33+
-behaviour(ct_suite).
34+
3335
-include_lib("eunit/include/eunit.hrl").
34-
-include_lib("common_test/include/ct.hrl").
3536

3637
-export([all/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2,
3738
end_per_testcase/2, get_undefined_binary/1, get_undefined_txt/1, get_set_binary/1,

test/mero_wrk_tcp_binary_SUITE.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
%%
2929
-module(mero_wrk_tcp_binary_SUITE).
3030

31+
-behaviour(ct_suite).
32+
3133
-include_lib("mero/include/mero.hrl").
32-
-include_lib("common_test/include/ct.hrl").
3334
-include_lib("eunit/include/eunit.hrl").
3435

3536
-export([all/0, init_per_testcase/2, end_per_testcase/2, mero_get_not_found/1,

test/mero_wrk_tcp_txt_SUITE.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
%%
2929
-module(mero_wrk_tcp_txt_SUITE).
3030

31+
-behaviour(ct_suite).
32+
3133
-include_lib("mero/include/mero.hrl").
32-
-include_lib("common_test/include/ct.hrl").
3334
-include_lib("eunit/include/eunit.hrl").
3435

3536
-export([all/0, init_per_testcase/2, end_per_testcase/2, mero_get_not_found/1,

0 commit comments

Comments
 (0)