Skip to content

Commit c51d0cd

Browse files
committed
wip
1 parent 29d2f58 commit c51d0cd

File tree

6 files changed

+19
-15
lines changed

6 files changed

+19
-15
lines changed

deps/rabbitmq_ct_helpers/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ PROJECT = rabbitmq_ct_helpers
22
PROJECT_DESCRIPTION = Common Test helpers for RabbitMQ
33

44
DEPS = rabbit_common proper inet_tcp_proxy meck
5-
TEST_DEPS = rabbit
5+
LOCAL_DEPS = common_test eunit inets
6+
#TEST_DEPS = rabbit
7+
8+
dialyze: DEPS += rabbit
69

710
XREF_IGNORE = [ \
811
{'Elixir.OptionParser',split,1}, \

deps/rabbitmq_ct_helpers/src/rabbit_control_helper.erl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ wait_for_async_command(Node) ->
4040

4141
command_with_output(Command, Node, Args, Opts) ->
4242
Formatted = format_command(Command, Node, Args, Opts),
43-
CommandResult = 'Elixir.RabbitMQCtl':exec_command(
43+
Mod = 'Elixir.RabbitMQCtl', %% To silence a Dialyzer warning.
44+
CommandResult = Mod:exec_command(
4445
Formatted, fun(Output,_,_) -> Output end),
4546
ct:pal("Executed command ~tp against node ~tp~nResult: ~tp~n", [Formatted, Node, CommandResult]),
4647
CommandResult.
@@ -50,7 +51,8 @@ format_command(Command, Node, Args, Opts) ->
5051
[Command,
5152
format_args(Args),
5253
format_options([{"--node", Node} | Opts])]),
53-
'Elixir.OptionParser':split(iolist_to_binary(Formatted)).
54+
Mod = 'Elixir.OptionParser', %% To silence a Dialyzer warning.
55+
Mod:split(iolist_to_binary(Formatted)).
5456

5557
format_args(Args) ->
5658
iolist_to_binary([ io_lib:format("~tp ", [Arg]) || Arg <- Args ]).

deps/rabbitmq_ct_helpers/src/rabbit_ct_broker_helpers.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ wait_for_rabbitmq_nodes(Config, Starting, NodeConfigs, Clustered) ->
393393
NodeConfigs1 = [NC || {_, NC} <- NodeConfigs],
394394
Config1 = rabbit_ct_helpers:set_config(Config,
395395
{rmq_nodes, NodeConfigs1}),
396-
stop_rabbitmq_nodes(Config1),
396+
_ = stop_rabbitmq_nodes(Config1),
397397
Error;
398398
{Pid, I, NodeConfig} when NodeConfigs =:= [] ->
399399
wait_for_rabbitmq_nodes(Config, Starting -- [Pid],
@@ -1940,7 +1940,7 @@ kill_node(Config, Node) ->
19401940
_ ->
19411941
rabbit_misc:format("kill -9 ~ts", [Pid])
19421942
end,
1943-
os:cmd(Cmd),
1943+
_ = os:cmd(Cmd),
19441944
await_os_pid_death(Pid).
19451945

19461946
kill_node_after(Config, Node, Sleep) ->

deps/rabbitmq_ct_helpers/src/rabbit_ct_helpers.erl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ redirect_logger_to_ct_logs(Config) ->
155155
ct:pal(
156156
?LOW_IMPORTANCE,
157157
"Configuring logger to send logs to common_test logs"),
158-
logger:set_handler_config(cth_log_redirect, level, debug),
158+
ok = logger:set_handler_config(cth_log_redirect, level, debug),
159159

160160
%% Let's use the same format as RabbitMQ itself.
161-
logger:set_handler_config(
161+
ok = logger:set_handler_config(
162162
cth_log_redirect, formatter,
163163
rabbit_prelaunch_early_logging:default_file_formatter(#{})),
164164

@@ -170,7 +170,7 @@ redirect_logger_to_ct_logs(Config) ->
170170
cth_log_redirect_any_domains, cth_log_redirect_any_domains,
171171
LogCfg),
172172

173-
logger:remove_handler(default),
173+
ok = logger:remove_handler(default),
174174

175175
ct:pal(
176176
?LOW_IMPORTANCE,
@@ -686,7 +686,6 @@ load_elixir(Config) ->
686686
ElixirLibDir ->
687687
ct:pal(?LOW_IMPORTANCE, "Elixir lib dir: ~ts~n", [ElixirLibDir]),
688688
true = code:add_pathz(ElixirLibDir),
689-
application:load(elixir),
690689
{ok, _} = application:ensure_all_started(elixir),
691690
Config
692691
end.
@@ -947,7 +946,7 @@ port_receive_loop(Port, Stdout, Options, Until, DumpTimer) ->
947946
end,
948947
receive
949948
{Port, {exit_status, X}} ->
950-
timer:cancel(DumpTimer),
949+
_ = timer:cancel(DumpTimer),
951950
DropStdout = lists:member(drop_stdout, Options) orelse
952951
Stdout =:= "",
953952
if

deps/rabbitmq_ct_helpers/src/rabbit_ct_vm_helpers.erl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ spawn_terraform_vms(Config) ->
499499
rabbit_ct_helpers:register_teardown_steps(
500500
Config1, teardown_steps());
501501
_ ->
502-
destroy_terraform_vms(Config),
502+
_ = destroy_terraform_vms(Config),
503503
{skip, "Terraform failed to spawn VM"}
504504
end.
505505

@@ -696,7 +696,7 @@ ensure_instance_count(Config, TRef) ->
696696
poll_vms(Config)
697697
end;
698698
true ->
699-
timer:cancel(TRef),
699+
_ = timer:cancel(TRef),
700700
rabbit_ct_helpers:set_config(Config,
701701
{terraform_poll_done, true})
702702
end;
@@ -760,7 +760,7 @@ initialize_ct_peers(Config, NodenamesMap, IPAddrsMap) ->
760760
set_inet_hosts(Config) ->
761761
CTPeers = get_ct_peer_entries(Config),
762762
inet_db:set_lookup([file, native]),
763-
[begin
763+
_ = [begin
764764
Hostname = ?config(hostname, CTPeerConfig),
765765
IPAddr = ?config(ipaddr, CTPeerConfig),
766766
inet_db:add_host(IPAddr, [Hostname]),
@@ -831,7 +831,7 @@ wait_for_ct_peers(Config, [CTPeer | Rest] = CTPeers, TRef) ->
831831
end
832832
end;
833833
wait_for_ct_peers(Config, [], TRef) ->
834-
timer:cancel(TRef),
834+
_ = timer:cancel(TRef),
835835
Config.
836836

837837
set_ct_peers_code_path(Config) ->

deps/rabbitmq_ct_helpers/src/rabbit_mgmt_test_util.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ uri_base_from(Config, Node) ->
107107
uri_base_from(Config, Node, Base) ->
108108
Port = mgmt_port(Config, Node),
109109
Prefix = get_uri_prefix(Config),
110-
Uri = rabbit_mgmt_format:print("http://localhost:~w~ts/~ts", [Port, Prefix, Base]),
110+
Uri = list_to_binary(lists:flatten(io_lib:format("http://localhost:~w~ts/~ts", [Port, Prefix, Base]))),
111111
binary_to_list(Uri).
112112

113113
get_uri_prefix(Config) ->

0 commit comments

Comments
 (0)