diff --git a/.gitignore b/.gitignore index 65c832f25bd..f5b235a81f3 100644 --- a/.gitignore +++ b/.gitignore @@ -123,6 +123,7 @@ big_tests/src/mim_ct_rest.erl big_tests/src/mim_ct_rest_handler.erl big_tests/src/mim_ct_sup.erl big_tests/priv/ssl +big_tests/tests/mongooseimctl_SUITE_data/roster.template test_preset.log codecov.json diff --git a/big_tests/src/ct_groups_summary_hook.erl b/big_tests/src/ct_groups_summary_hook.erl index 3a17945fa70..2e1bc8d7cfe 100644 --- a/big_tests/src/ct_groups_summary_hook.erl +++ b/big_tests/src/ct_groups_summary_hook.erl @@ -20,7 +20,7 @@ id(_Opts) -> %% @doc Always called before any other callback function. Use this to initiate %% any common state. -init(_Id, Opts) -> +init(_Id, _Opts) -> %ct:pal("init opts: ~p", [Opts]), {ok, #{total_ok => 0, total_failed => 0, diff --git a/big_tests/src/ct_markdown_errors_hook.erl b/big_tests/src/ct_markdown_errors_hook.erl index 49b57bebd8f..01f72e9d7e7 100644 --- a/big_tests/src/ct_markdown_errors_hook.erl +++ b/big_tests/src/ct_markdown_errors_hook.erl @@ -34,7 +34,7 @@ post_init_per_suite(SuiteName, Config, Return, State) -> State2 = handle_return(SuiteName, init_per_suite, Return, Config, State), {Return, State2#state{suite = SuiteName}}. -post_init_per_group(GroupName, Config, Return, State=#state{suite = SuiteName}) -> +post_init_per_group(_GroupName, Config, Return, State=#state{suite = SuiteName}) -> State2 = handle_return(SuiteName, init_per_group, Return, Config, State), {Return, State2#state{}}. @@ -46,7 +46,7 @@ post_end_per_suite(SuiteName, Config, Return, State) -> State2 = handle_return(SuiteName, end_per_suite, Return, Config, State), {Return, State2#state{suite = ''}}. -post_end_per_group(GroupName, Config, Return, State=#state{suite = SuiteName}) -> +post_end_per_group(_GroupName, Config, Return, State=#state{suite = SuiteName}) -> State2 = handle_return(SuiteName, end_per_group, Return, Config, State), {Return, State2#state{}}. @@ -76,7 +76,7 @@ handle_return_unsafe(SuiteName, Place, Return, Config, State) -> exec_limited_number_of_times(F, State) end. -exec_limited_number_of_times(F, State=#state{limit=0, file=File, +exec_limited_number_of_times(_F, State=#state{limit=0, file=_File, truncated_counter_file = TrFile}) -> %% Log truncated, increment counter TrCounter = old_truncated_counter_value(TrFile), @@ -99,8 +99,8 @@ log_summary(SuiteName, GroupName, Place, #state{summary_file = SummaryFile}) -> file:write_file(SummaryFile, [SummaryText, $\n], [append]), ok. -log_error(SuiteName, GroupName, Place, Error, Config, #state{file = File, summary_file = SummaryFile}) -> - MaybeLogLink = make_log_link(Config), +log_error(SuiteName, GroupName, Place, Error, Config, #state{file = File, summary_file = _SummaryFile}) -> + _MaybeLogLink = make_log_link(Config), LogLink = make_log_link(Config), %% Spoler syntax %% https://github.com/dear-github/dear-github/issues/166 @@ -132,7 +132,6 @@ make_summary_text(SuiteName, GroupName, TC) -> make_log_link(Config) -> LogFile = proplists:get_value(tc_logfile, Config, ""), - LogLink = case LogFile of "" -> <<>>; diff --git a/big_tests/src/ct_mongoose_log_hook.erl b/big_tests/src/ct_mongoose_log_hook.erl index 46adf920387..14706b860d3 100644 --- a/big_tests/src/ct_mongoose_log_hook.erl +++ b/big_tests/src/ct_mongoose_log_hook.erl @@ -55,7 +55,7 @@ pre_end_per_suite(_Suite,Config,State) -> {Config, State#state{suite=no_suite}}. %% @doc Called after end_per_suite. -post_end_per_suite(Suite,_Config,Return,State) -> +post_end_per_suite(_Suite,_Config,Return,State) -> {Return, State}. %% @doc Called before each init_per_group. @@ -67,7 +67,7 @@ post_init_per_group(_Group,_Config,Return,State) -> {Return, State}. %% @doc Called after each end_per_group. -pre_end_per_group(Group,Config,State) -> +pre_end_per_group(_Group,Config,State) -> {Config, State#state{group=no_group}}. %% @doc Called after each end_per_group. @@ -97,11 +97,11 @@ on_tc_fail(_TC, _Reason, State) -> %% @doc Called when a test case is skipped by either user action %% or due to an init function failing. -on_tc_skip(_TC, Reason, State) -> +on_tc_skip(_TC, _Reason, State) -> State. %% @doc Called when the scope of the CTH is done -terminate(State) -> +terminate(_State) -> ok. @@ -138,7 +138,7 @@ read_new_lines(Reader) -> [] end. -read_and_write_lines(Node, Reader, Writer, CurrentLineNum) when is_integer(CurrentLineNum) -> +read_and_write_lines(_Node, Reader, Writer, CurrentLineNum) when is_integer(CurrentLineNum) -> Lines = read_new_lines(Reader), write_lines(Lines, CurrentLineNum+1, Writer), CurrentLineNum + length(Lines). % new current line @@ -180,7 +180,7 @@ ensure_initialized(Config, State=#state{node=Node, cookie=Cookie, out_file=undef [node(), Reader, node(Reader), Writer, OutFile]), State#state{reader=Reader, writer=Writer, out_file=OutFile, current_line_num=CurrentLineNum, url_file=UrlFile} - catch Class:Reason:Stacktrace -> + catch _Class:Reason:Stacktrace -> ct:pal("issue=\"Failed to init ct_mongoose_log_hook\"~n node=~p~n " "reason=~p~n stacktrace=~p", [Node, Reason, Stacktrace]), @@ -212,7 +212,6 @@ post_insert_line_numbers_into_report(State=#state{node=Node, reader=Reader, writ current_line_num=CurrentLineNum, url_file=UrlFile, group=Group, suite=Suite, priv_dir=PrivDir}, TC) -> CurrentLineNum2 = read_and_write_lines(Node, Reader, Writer, CurrentLineNum), - Heading = atom_to_list(Node), add_log_link_to_line(PrivDir, UrlFile, CurrentLineNum2, Node, " when finished"), %% Write a message after the main part Message = io_lib:format( @@ -230,7 +229,7 @@ add_log_link_to_line(PrivDir, UrlFile, LogLine, Node, ExtraDescription) -> %% Function `escalus_ct:add_log_link(Heading, URL, Type).' %% allows to add simple links. -%% +%% %% We can't add link with label (i.e. index.html#LABEL), because it would be escaped. %% Let's create an HTML file for each link we want to insert, and insert our custom %% redirect code inside. @@ -263,7 +262,7 @@ open_file_without_linking(Node, File, Opts) -> Res = rpc:block_call(Node, file, open, [File, Opts], 5000), check_result(Node, File, Res). -check_result(Node, File, {ok, _} = Res) -> +check_result(_Node, _File, {ok, _} = Res) -> Res; check_result(Node, File, Res) -> ct:fail({open_file_failed, Node, File, Res}). diff --git a/big_tests/src/ct_tty_hook.erl b/big_tests/src/ct_tty_hook.erl index 090593869c0..357ba83c8a2 100644 --- a/big_tests/src/ct_tty_hook.erl +++ b/big_tests/src/ct_tty_hook.erl @@ -85,7 +85,7 @@ pre_init_per_testcase(TC,Config,State = #state{suite_total = Total}) when is_integer(Total) -> print_case_enter(TC, State, "Starting"), {Config, State#state{ ts = os:timestamp(), total = Total + 1 } }; -pre_init_per_testcase(TC, Config, State) -> +pre_init_per_testcase(_TC, Config, State) -> {Config, State}. %% @doc Called after each test case. diff --git a/big_tests/src/ejabberd_tests.app.src b/big_tests/src/mongoose_tests.app.src similarity index 79% rename from big_tests/src/ejabberd_tests.app.src rename to big_tests/src/mongoose_tests.app.src index 6f0a4ba8f52..ebeceb1c220 100644 --- a/big_tests/src/ejabberd_tests.app.src +++ b/big_tests/src/mongoose_tests.app.src @@ -1,6 +1,6 @@ -{application, ejabberd_tests, +{application, mongoose_tests, [ - {description, ""}, + {description, "MongooseIM big tests"}, {vsn, git}, {registered, []}, {applications, [ diff --git a/big_tests/tests/acc_e2e_SUITE.erl b/big_tests/tests/acc_e2e_SUITE.erl index 9579aeb8ced..bd9a80bf769 100644 --- a/big_tests/tests/acc_e2e_SUITE.erl +++ b/big_tests/tests/acc_e2e_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(acc_e2e_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("exml/include/exml.hrl"). -include_lib("escalus/include/escalus.hrl"). diff --git a/big_tests/tests/acc_e2e_SUITE_data/acc_test_helper.erl b/big_tests/tests/acc_e2e_SUITE_data/acc_test_helper.erl index 32c095bcbe7..c408e0a0dcc 100644 --- a/big_tests/tests/acc_e2e_SUITE_data/acc_test_helper.erl +++ b/big_tests/tests/acc_e2e_SUITE_data/acc_test_helper.erl @@ -1,7 +1,7 @@ -module(acc_test_helper). -author("bartek"). --compile(export_all). +-compile([export_all, nowarn_export_all]). test_save_acc(#{ stanza := #{ type := <<"chat">>} } = Acc, _State) -> Rand = rand:uniform(), diff --git a/big_tests/tests/accounts_SUITE.erl b/big_tests/tests/accounts_SUITE.erl index 0a0b90f598c..95ed81f1500 100644 --- a/big_tests/tests/accounts_SUITE.erl +++ b/big_tests/tests/accounts_SUITE.erl @@ -1,5 +1,5 @@ -module(accounts_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("escalus/include/escalus_xmlns.hrl"). diff --git a/big_tests/tests/adhoc_SUITE.erl b/big_tests/tests/adhoc_SUITE.erl index ec0cef03284..11881a343b8 100644 --- a/big_tests/tests/adhoc_SUITE.erl +++ b/big_tests/tests/adhoc_SUITE.erl @@ -14,7 +14,7 @@ %% limitations under the License. %%============================================================================== -module(adhoc_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). diff --git a/big_tests/tests/amp_big_SUITE.erl b/big_tests/tests/amp_big_SUITE.erl index df8440af90a..6278a1d51d7 100644 --- a/big_tests/tests/amp_big_SUITE.erl +++ b/big_tests/tests/amp_big_SUITE.erl @@ -5,7 +5,7 @@ %% @copyright 2014 Erlang Solutions, Ltd. %% This work was sponsored by Grindr.com --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("escalus/include/escalus.hrl"). -include_lib("escalus/include/escalus_xmlns.hrl"). @@ -122,7 +122,7 @@ init_per_suite(Config) -> amp_test_helper_code() -> "-module(amp_test_helper).\n" - "-compile(export_all).\n" + "-compile([export_all, nowarn_export_all]).\n" "setup_meck() ->\n" " meck:expect(ejabberd_socket, send, fun ejabberd_socket_send/2).\n" "ejabberd_socket_send(Socket, Data) ->\n" diff --git a/big_tests/tests/anonymous_SUITE.erl b/big_tests/tests/anonymous_SUITE.erl index c377268d71f..ad9b6da36cd 100644 --- a/big_tests/tests/anonymous_SUITE.erl +++ b/big_tests/tests/anonymous_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(anonymous_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). diff --git a/big_tests/tests/bosh_SUITE.erl b/big_tests/tests/bosh_SUITE.erl index 51c3ac90ffc..5ff0c36d047 100644 --- a/big_tests/tests/bosh_SUITE.erl +++ b/big_tests/tests/bosh_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(bosh_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). diff --git a/big_tests/tests/bosh_interleave_reqs.erl b/big_tests/tests/bosh_interleave_reqs.erl index bf7e0ccd624..6b509741cb2 100644 --- a/big_tests/tests/bosh_interleave_reqs.erl +++ b/big_tests/tests/bosh_interleave_reqs.erl @@ -10,7 +10,7 @@ -export([test/1, sample/0, prop/1]). --export([initial_state/1, command/1, precondition/2, postcondition/3, +-export([initial_state/0, initial_state/1, command/1, precondition/2, postcondition/3, next_state/3]). -export([read_config/1, @@ -63,6 +63,9 @@ maybe_stop_client(Client) -> ct:pal("There was timeout ~p when stopping ~p", [Details, Client]) end. +initial_state() -> + #state{}. + initial_state(Pid) -> #state{carol = undefined, alice = undefined, @@ -157,7 +160,7 @@ wait_for_msgs_carol(Carol, Msgs) -> wait_for_msgs_alice(Alice, Msgs) -> wait_for_msgs(Alice, lists:reverse(Msgs)). -wait_for_msgs(Client, []) -> +wait_for_msgs(_Client, []) -> ok; wait_for_msgs(Client, All) -> StanzasFromServer = escalus:wait_for_stanzas(Client, length(All), timer:seconds(5)), diff --git a/big_tests/tests/carboncopy_SUITE.erl b/big_tests/tests/carboncopy_SUITE.erl index 593958c8137..1832691f3f7 100644 --- a/big_tests/tests/carboncopy_SUITE.erl +++ b/big_tests/tests/carboncopy_SUITE.erl @@ -1,6 +1,6 @@ -module(carboncopy_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("proper/include/proper.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/big_tests/tests/cluster_commands_SUITE.erl b/big_tests/tests/cluster_commands_SUITE.erl index 60484d67c82..ac058dd1f70 100644 --- a/big_tests/tests/cluster_commands_SUITE.erl +++ b/big_tests/tests/cluster_commands_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(cluster_commands_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -import(distributed_helper, [add_node_to_cluster/2, is_sm_distributed/0, @@ -390,7 +390,7 @@ remove_dead_from_cluster(Config) -> % given Timeout = timer:seconds(60), #{node := Node1Nodename} = Node1 = mim(), - #{node := Node2Nodename} = Node2 = mim2(), + #{node := _Node2Nodename} = Node2 = mim2(), #{node := Node3Nodename} = Node3 = mim3(), ok = rpc(Node2#{timeout => Timeout}, mongoose_cluster, join, [Node1Nodename]), ok = rpc(Node3#{timeout => Timeout}, mongoose_cluster, join, [Node1Nodename]), diff --git a/big_tests/tests/common_helper.erl b/big_tests/tests/common_helper.erl index a92e7faa597..565e166ea5f 100644 --- a/big_tests/tests/common_helper.erl +++ b/big_tests/tests/common_helper.erl @@ -1,6 +1,5 @@ -module(common_helper). --compile(export_all). - +-compile([export_all, nowarn_export_all]). get_bjid(UserSpec) -> User = proplists:get_value(username, UserSpec), diff --git a/big_tests/tests/component_SUITE.erl b/big_tests/tests/component_SUITE.erl index 5d323689269..476e429c90b 100644 --- a/big_tests/tests/component_SUITE.erl +++ b/big_tests/tests/component_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(component_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). diff --git a/big_tests/tests/connect_SUITE.erl b/big_tests/tests/connect_SUITE.erl index 64d42ba5b8c..6484a510905 100644 --- a/big_tests/tests/connect_SUITE.erl +++ b/big_tests/tests/connect_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(connect_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). @@ -172,8 +172,6 @@ init_per_group(just_tls,Config)-> [{tls_module, just_tls} | Config]; init_per_group(fast_tls,Config)-> [{tls_module, fast_tls} | Config]; -init_per_group(session_replacement, Config) -> - Config; init_per_group(proxy_protocol, Config) -> config_ejabberd_node_c2s(Config, [{proxy_protocol, true}]), Config; @@ -722,7 +720,7 @@ connect_with_proxy_header(Config) -> %% WHEN ConnectionSteps = [{?MODULE, send_proxy_header}, start_stream, stream_features, authenticate, bind, session], - {ok, Conn, Features} = escalus_connection:start(UserSpec, ConnectionSteps), + {ok, Conn, _Features} = escalus_connection:start(UserSpec, ConnectionSteps), % make sure the session is present escalus:send(Conn, escalus_stanza:presence(<<"available">>)), escalus:assert(is_presence, escalus:wait_for_stanza(Conn)), diff --git a/big_tests/tests/disco_and_caps_SUITE.erl b/big_tests/tests/disco_and_caps_SUITE.erl index a5cc9292ee5..803e7b91a15 100644 --- a/big_tests/tests/disco_and_caps_SUITE.erl +++ b/big_tests/tests/disco_and_caps_SUITE.erl @@ -1,5 +1,5 @@ -module(disco_and_caps_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("eunit/include/eunit.hrl"). -include_lib("escalus/include/escalus_xmlns.hrl"). @@ -44,7 +44,7 @@ init_per_group(Name, C) -> dynamic_modules:ensure_modules(host_type(), required_modules(Name)), C2. -end_per_group(Name, C) -> +end_per_group(_Name, C) -> dynamic_modules:restore_modules(host_type(), C). init_per_testcase(Name, C) -> diff --git a/big_tests/tests/distributed_helper.erl b/big_tests/tests/distributed_helper.erl index 4cb67a1f322..4fbc8178805 100644 --- a/big_tests/tests/distributed_helper.erl +++ b/big_tests/tests/distributed_helper.erl @@ -5,7 +5,7 @@ -import(ejabberd_node_utils, [get_cwd/2]). --compile(export_all). +-compile([export_all, nowarn_export_all]). -type rpc_spec() :: #{node := node(), cookie => atom(), diff --git a/big_tests/tests/domain_isolation_SUITE.erl b/big_tests/tests/domain_isolation_SUITE.erl index 40131167ae2..65f8b68fe4e 100644 --- a/big_tests/tests/domain_isolation_SUITE.erl +++ b/big_tests/tests/domain_isolation_SUITE.erl @@ -3,7 +3,7 @@ -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). --compile(export_all). +-compile([export_all, nowarn_export_all]). -import(distributed_helper, [mim/0, require_rpc_nodes/1, rpc/4, subhost_pattern/1]). -import(domain_helper, [host_type/0, secondary_host_type/0]). diff --git a/big_tests/tests/domain_removal_SUITE.erl b/big_tests/tests/domain_removal_SUITE.erl index 65fba3187c3..7bb505ce326 100644 --- a/big_tests/tests/domain_removal_SUITE.erl +++ b/big_tests/tests/domain_removal_SUITE.erl @@ -1,6 +1,6 @@ -module(domain_removal_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -import(distributed_helper, [mim/0, rpc/4, subhost_pattern/1]). -import(domain_helper, [host_type/0, domain/0]). diff --git a/big_tests/tests/dynamic_domains_SUITE.erl b/big_tests/tests/dynamic_domains_SUITE.erl index 761e772fc8f..183846055a2 100644 --- a/big_tests/tests/dynamic_domains_SUITE.erl +++ b/big_tests/tests/dynamic_domains_SUITE.erl @@ -3,7 +3,7 @@ -include_lib("exml/include/exml.hrl"). %% API --compile(export_all). +-compile([export_all, nowarn_export_all]). -import(distributed_helper, [mim/0, mim2/0, rpc/4, require_rpc_nodes/1, subhost_pattern/1]). diff --git a/big_tests/tests/extdisco_SUITE.erl b/big_tests/tests/extdisco_SUITE.erl index cf0de1110d5..7ca6fe657c7 100644 --- a/big_tests/tests/extdisco_SUITE.erl +++ b/big_tests/tests/extdisco_SUITE.erl @@ -26,7 +26,7 @@ -define(NS_EXTDISCO, <<"urn:xmpp:extdisco:2">>). --compile([export_all]). +-compile([export_all, nowarn_export_all]). all() -> [{group, extdisco_not_configured}, diff --git a/big_tests/tests/jingle_SUITE.erl b/big_tests/tests/jingle_SUITE.erl index 16ec5e5cfb0..0637d736ca4 100644 --- a/big_tests/tests/jingle_SUITE.erl +++ b/big_tests/tests/jingle_SUITE.erl @@ -1,5 +1,5 @@ -module(jingle_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("exml/include/exml.hrl"). diff --git a/big_tests/tests/jingle_sip_translator.erl b/big_tests/tests/jingle_sip_translator.erl index d2fc9a9f0de..ba2cf78865b 100644 --- a/big_tests/tests/jingle_sip_translator.erl +++ b/big_tests/tests/jingle_sip_translator.erl @@ -33,16 +33,16 @@ message_in(#sip{method = <<"CANCEL">>} = Sip, _Socket) -> message_in(Sip, _Socket) -> Sip. -message_out(Sip, Socket) -> +message_out(Sip, _Socket) -> Sip. -request(Sip, Socket) -> +request(Sip, _Socket) -> Sip. -request(#sip{method = <<"INVITE">>, hdrs = Hdrs, uri = Uri} = Sip, Socket, Tr) -> +request(#sip{method = <<"INVITE">>, hdrs = Hdrs, uri = _Uri} = Sip, Socket, Tr) -> {ReqBack, Contact} = make_forward_req(Sip), - {To, ToURI, _} = esip:get_hdr(to, Hdrs), + {To, _ToURI, _} = esip:get_hdr(to, Hdrs), case To of <<"error.", ErrorCode/binary>> -> @@ -52,11 +52,11 @@ request(#sip{method = <<"INVITE">>, hdrs = Hdrs, uri = Uri} = Sip, Socket, Tr) - status = ErrorInt, hdrs = [{contact, [Contact]}]}, %% contact headers is needed so that the dialog know where to send packets esip:make_tag()); %% tag is needed to create dialog on the reciving side - <<"+", Number/binary>> -> + <<"+", _Number/binary>> -> {_, Resp} = make_provisional_response(Sip, 183, Contact), timer:apply_after(200, ?MODULE, make_200_ok_for_phone_call, [Tr, Sip, Resp]), Resp; - <<"*", Number/binary>> -> + <<"*", _Number/binary>> -> {_, Resp} = make_provisional_response(Sip, 183, Contact), timer:apply_after(200, ?MODULE, make_200_ok_for_conference_call, [Socket, Tr, Sip, Resp]), Resp; @@ -72,13 +72,10 @@ request(Sip, Socket, Tr) -> ct:pal("UNKNOWN req: ~p~nsock: ~p~ntr: ~p", [Sip, Socket, Tr]), error. -noop(Arg) -> - ok. - make_provisional_response(Request, Status, Contact) -> make_provisional_response(Request, Status, Contact, undefined). -make_provisional_response(#sip{hdrs = Hdrs} = Sip, Status, Contact, CorrespondingCallID) -> +make_provisional_response(#sip{hdrs = Hdrs} = Sip, Status, Contact, _CorrespondingCallID) -> %% Make provisional response to initiator Tag = esip:make_tag(), Resp = esip:make_response(Sip, #sip{type = response, @@ -100,7 +97,7 @@ make_provisional_response(#sip{hdrs = Hdrs} = Sip, Status, Contact, Correspondin {Tag, Resp}. send_invite_back(Socket, Sip, ReqBack, Tag, Tr) -> - {ok, TrID} = esip:request(Socket, ReqBack, + {ok, _TrID} = esip:request(Socket, ReqBack, {?MODULE, back_invite_callbacks, [Sip, Tr, ReqBack, Tag]}), InitialID = esip:get_hdr('call-id', Sip#sip.hdrs), BackID = esip:get_hdr('call-id', ReqBack#sip.hdrs), @@ -108,7 +105,7 @@ send_invite_back(Socket, Sip, ReqBack, Tag, Tr) -> ets:insert(jingle_sip_translator_bindings, {BackID, InitialID}), ok. -make_200_ok_for_phone_call(Tr, Sip, #sip{hdrs = RespHdrs} = Resp183) -> +make_200_ok_for_phone_call(Tr, Sip, #sip{hdrs = RespHdrs} = _Resp183) -> {_, _, Params} = esip:get_hdr(to, RespHdrs), Tag = esip:get_param(<<"tag">>, Params), Resp = esip:make_response(Sip, #sip{type = response, @@ -119,7 +116,7 @@ make_200_ok_for_phone_call(Tr, Sip, #sip{hdrs = RespHdrs} = Resp183) -> make_200_ok_for_conference_call(Socket, Tr, #sip{hdrs = Hdrs} = Sip, #sip{hdrs = RespHdrs} = Resp183) -> make_200_ok_for_phone_call(Tr, Sip, Resp183), - {_, #uri{user = ReceiverUser}, Params} = Receiver = esip:get_hdr(to, RespHdrs), + {_, #uri{user = ReceiverUser}, _Params} = Receiver = esip:get_hdr(to, RespHdrs), {_, _, _} = Initiator = esip:get_hdr(from, RespHdrs), Branch = base16:encode(crypto:strong_rand_bytes(3)), URIBin = <<"sip:",ReceiverUser/binary,"@127.0.0.1:12345;ob;transport=tcp">>, @@ -170,7 +167,7 @@ back_invite_callbacks(#sip{type = response, method = <<"INVITE">>, Socket, TrID, InitialReq, InitialTr, ForwardedRequest, Tag) -> send_ack_for_200_ok(Resp, Socket, TrID, ForwardedRequest), %% Forward reply to the initial req - CallID = esip:get_hdr('call-id', Hdrs), + _CallID = esip:get_hdr('call-id', Hdrs), Reply = esip:make_response(InitialReq, #sip{type = response, status = 200, @@ -179,10 +176,10 @@ back_invite_callbacks(#sip{type = response, method = <<"INVITE">>, esip:reply(InitialTr, Reply), ok; -back_invite_callbacks(#sip{type = response, status = 180, hdrs = Hdrs} = Sip, _, TrID, - InitialReq, InitialTr, ForwardedRequest, Tag) -> - {_, #uri{user = ToUser}, _} = To = esip:get_hdr(to, Hdrs), - {_, #uri{user = FromUser}, _} = From = esip:get_hdr(from, Hdrs), +back_invite_callbacks(#sip{type = response, status = 180, hdrs = Hdrs} = Sip, _, _TrID, + _InitialReq, _InitialTr, ForwardedRequest, Tag) -> + {_, #uri{user = _ToUser}, _} = To = esip:get_hdr(to, Hdrs), + {_, #uri{user = _FromUser}, _} = From = esip:get_hdr(from, Hdrs), CallID = esip:get_hdr('call-id', Hdrs), {ok, DialogId} = esip_dialog:open(ForwardedRequest, Sip, uac, {?MODULE, dialog_callback, []}), ct:pal("Back Dialog ~p for call ~p", [DialogId, CallID]), @@ -200,15 +197,15 @@ back_invite_callbacks(#sip{type = response, status = 486}, _, _TrId, InitialReq, Tag), esip:reply(InitialTr, Reply), ok; -back_invite_callbacks(_Sip, _, _TrId, _InitialReq, _InitialTr, _, Tag) -> +back_invite_callbacks(_Sip, _, _TrId, _InitialReq, _InitialTr, _, _Tag) -> ok. in_invite_transaction_callback(#sip{type = request, method = <<"CANCEL">>, hdrs = Hdrs} = Sip, - Socket, Tr, #sip{hdrs = ReqBackHdrs}) -> + Socket, _Tr, #sip{hdrs = ReqBackHdrs}) -> %% We want to preserve From and To headers so that we know who CANCELed the INVITE - {_, #uri{user = FromUserReq}, _} = esip:get_hdr(from, Hdrs), - {_, #uri{user = ToUser}, _} = esip:get_hdr(to, Hdrs), + {_, #uri{user = _FromUserReq}, _} = esip:get_hdr(from, Hdrs), + {_, #uri{user = _ToUser}, _} = esip:get_hdr(to, Hdrs), Contact = esip:get_hdr(contact, ReqBackHdrs), CorrespondingCall = esip:get_hdr('call-id', ReqBackHdrs), @@ -224,7 +221,7 @@ in_invite_transaction_callback(#sip{type = request, method = <<"CANCEL">>, hdrs Hdrs2 = [{via, Via}, {'call-id', CorrespondingCall}, {contact, Contact} | Hdrs1], ReqBack = Sip#sip{uri = esip_codec:decode_uri(<<"sip:127.0.0.1:5600">>), hdrs = Hdrs2}, - {ok, TrID} = esip:request(Socket, ReqBack), + {ok, _TrID} = esip:request(Socket, ReqBack), esip:make_response(Sip, #sip{type = response, status = 487}); in_invite_transaction_callback(Req, Socket, Tr, CorrespondingCall) -> @@ -234,7 +231,7 @@ in_invite_transaction_callback(Req, Socket, Tr, CorrespondingCall) -> dialog_callback(#sip{type = request, method = <<"ACK">>}, _, _) -> ok; %% Below function forwards any in-dialog request to correspoding jingle session -dialog_callback(#sip{type = request, hdrs = Hdrs} = Req, Socket, Tr) -> +dialog_callback(#sip{type = request, hdrs = Hdrs} = Req, Socket, _Tr) -> CallID = esip:get_hdr('call-id', Hdrs), [{_, OtherCallID}] = ets:lookup(jingle_sip_translator_bindings, CallID), @@ -247,7 +244,7 @@ dialog_callback(#sip{type = request, hdrs = Hdrs} = Req, Socket, Tr) -> {_, #uri{user = FromUserReq}, _} = esip:get_hdr(from, Hdrs), {From, To} = get_from_and_to_for_request_and_call_id(OtherCallID, FromUserReq), {_, #uri{user = ToUser}, _} = To, - {_, #uri{user = FromUser}, _} = From, + {_, #uri{user = _FromUser}, _} = From, Branch = base16:encode(crypto:strong_rand_bytes(3)), URIBin = <<"sip:",ToUser/binary,"@127.0.0.1:12345;ob;transport=tcp">>, @@ -271,7 +268,7 @@ dialog_callback(#sip{type = request, hdrs = Hdrs} = Req, Socket, Tr) -> esip:make_response(Req, #sip{type = response, status = 200 }); -dialog_callback(SIP, Socket, Tr) -> +dialog_callback(SIP, _Socket, _Tr) -> ct:pal("unknown in-dialog sip msg: ~p", [SIP]). send_invite(From, To, Pid) -> @@ -308,18 +305,18 @@ send_invite(From, To, Pid) -> {'max-forwards', 70}]}, {ok, Socket} = esip:connect(Req), - {ok, TrID} = esip:request(Socket, Req, {?MODULE, send_message_to_test_on_resp, [Pid]}), + {ok, _TrID} = esip:request(Socket, Req, {?MODULE, send_message_to_test_on_resp, [Pid]}), ok. -send_message_to_test_on_resp(#sip{type = response, status = 100}, _Socket, _Tr, Pid) -> +send_message_to_test_on_resp(#sip{type = response, status = 100}, _Socket, _Tr, _Pid) -> ok; %% test is not interested in this resp send_message_to_test_on_resp(#sip{type = response, status = Status}, _Socket, _Tr, Pid) -> Pid ! {sip_resp, Status}. send_ack_for_200_ok(#sip{type = response, method = <<"INVITE">>, - hdrs = Hdrs, status = 200} = Resp, - Socket, TrID, #sip{uri = ReqURI, hdrs = ReqHdrs} = InitialReq) -> + hdrs = Hdrs, status = 200} = _Resp, + Socket, _TrID, #sip{uri = ReqURI, hdrs = ReqHdrs} = _InitialReq) -> Contact = esip:get_hdrs(contact, ReqHdrs), Hdrs1 = esip:filter_hdrs(['call-id', 'cseq', 'route', 'max-forwards', @@ -339,7 +336,7 @@ send_ack_for_200_ok(#sip{type = response, method = <<"INVITE">>, send_ack_for_200_ok(_, _, _, _) -> ok. -response(Sip, Socket) -> +response(Sip, _Socket) -> Sip. diff --git a/big_tests/tests/last_SUITE.erl b/big_tests/tests/last_SUITE.erl index 4c8665e7220..8c79484e006 100644 --- a/big_tests/tests/last_SUITE.erl +++ b/big_tests/tests/last_SUITE.erl @@ -14,7 +14,7 @@ %% limitations under the License. %%============================================================================== -module(last_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). diff --git a/big_tests/tests/login_SUITE.erl b/big_tests/tests/login_SUITE.erl index 097ee40f60a..069af6498a0 100644 --- a/big_tests/tests/login_SUITE.erl +++ b/big_tests/tests/login_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(login_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("escalus/include/escalus_xmlns.hrl"). diff --git a/big_tests/tests/mam_helper.erl b/big_tests/tests/mam_helper.erl index 863c333e4f7..676b6e018a9 100644 --- a/big_tests/tests/mam_helper.erl +++ b/big_tests/tests/mam_helper.erl @@ -896,14 +896,14 @@ generate_msg_for_date_user(Owner, {RemoteBin, _, _} = Remote, DateTime, Content) MicrosecDateTime = datetime_to_microseconds(DateTime), NowMicro = rpc_apply(erlang, system_time, [microsecond]), Microsec = min(NowMicro, MicrosecDateTime), - MsgIdOwner = rpc_apply(mod_mam_utils, encode_compact_uuid, [Microsec, random:uniform(20)]), - MsgIdRemote = rpc_apply(mod_mam_utils, encode_compact_uuid, [Microsec+1, random:uniform(20)]), + MsgIdOwner = rpc_apply(mod_mam_utils, encode_compact_uuid, [Microsec, rand:uniform(20)]), + MsgIdRemote = rpc_apply(mod_mam_utils, encode_compact_uuid, [Microsec+1, rand:uniform(20)]), Packet = escalus_stanza:chat_to(RemoteBin, Content), {{MsgIdOwner, MsgIdRemote}, Owner, Remote, Owner, Packet}. random_time() -> MaxSecondsInDay = 86399, - RandSeconds = random:uniform(MaxSecondsInDay), + RandSeconds = rand:uniform(MaxSecondsInDay), calendar:seconds_to_time(RandSeconds). datetime_to_microseconds({{_, _, _}, {_, _, _}} = DateTime) -> diff --git a/big_tests/tests/metrics_api_SUITE.erl b/big_tests/tests/metrics_api_SUITE.erl index 78551ae8e09..fda136ac4f0 100644 --- a/big_tests/tests/metrics_api_SUITE.erl +++ b/big_tests/tests/metrics_api_SUITE.erl @@ -14,7 +14,7 @@ %% limitations under the License. %%============================================================================== -module(metrics_api_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). diff --git a/big_tests/tests/metrics_c2s_SUITE.erl b/big_tests/tests/metrics_c2s_SUITE.erl index 615c3656315..c7402b3b5f0 100644 --- a/big_tests/tests/metrics_c2s_SUITE.erl +++ b/big_tests/tests/metrics_c2s_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(metrics_c2s_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). diff --git a/big_tests/tests/metrics_helper.erl b/big_tests/tests/metrics_helper.erl index 74a21a9327d..056ae956acc 100644 --- a/big_tests/tests/metrics_helper.erl +++ b/big_tests/tests/metrics_helper.erl @@ -1,6 +1,6 @@ -module(metrics_helper). --compile(export_all). +-compile([export_all, nowarn_export_all]). -import(distributed_helper, [mim/0, mim2/0, rpc/4]). diff --git a/big_tests/tests/metrics_register_SUITE.erl b/big_tests/tests/metrics_register_SUITE.erl index faa1592db86..aba502d4341 100644 --- a/big_tests/tests/metrics_register_SUITE.erl +++ b/big_tests/tests/metrics_register_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(metrics_register_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). diff --git a/big_tests/tests/metrics_roster_SUITE.erl b/big_tests/tests/metrics_roster_SUITE.erl index e85178edef8..38a13f4bc6a 100644 --- a/big_tests/tests/metrics_roster_SUITE.erl +++ b/big_tests/tests/metrics_roster_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(metrics_roster_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). diff --git a/big_tests/tests/metrics_session_SUITE.erl b/big_tests/tests/metrics_session_SUITE.erl index 9417fb1b0a6..07df9e03d5e 100644 --- a/big_tests/tests/metrics_session_SUITE.erl +++ b/big_tests/tests/metrics_session_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(metrics_session_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). diff --git a/big_tests/tests/mod_aws_sns_SUITE.erl b/big_tests/tests/mod_aws_sns_SUITE.erl index 45e3f7109da..ab6c85837ec 100644 --- a/big_tests/tests/mod_aws_sns_SUITE.erl +++ b/big_tests/tests/mod_aws_sns_SUITE.erl @@ -1,5 +1,5 @@ -module(mod_aws_sns_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/big_tests/tests/mod_blocking_SUITE.erl b/big_tests/tests/mod_blocking_SUITE.erl index cf0587a9128..830b96c8dc1 100644 --- a/big_tests/tests/mod_blocking_SUITE.erl +++ b/big_tests/tests/mod_blocking_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(mod_blocking_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("exml/include/exml.hrl"). -include_lib("escalus/include/escalus.hrl"). @@ -412,7 +412,7 @@ block_push_sent(Config) -> %% make sure privacy list push arrives to all the user's resources escalus:fresh_story( Config, [{alice, 2}, {bob, 2}], - fun(User1a, User1b, User2a, User2b) -> + fun(User1a, User1b, User2a, _User2b) -> user_blocks(User1a, [User2a]), client_gets_block_iq(User1b) end). @@ -563,9 +563,9 @@ is_xep191_push(Type, #xmlel{attrs = A, children = [#xmlel{name = Type, is_xep191_push(Type, [], #xmlel{children = [#xmlel{name = Type, children = []}]}=Stanza) -> is_xep191_push(Type, Stanza); -is_xep191_push(Type, [], #xmlel{children = [#xmlel{name = Type, children = Items}]}) -> +is_xep191_push(Type, [], #xmlel{children = [#xmlel{name = Type, children = _}]}) -> false; -is_xep191_push(Type, JIDs, #xmlel{attrs = A, children = [#xmlel{name = Type, +is_xep191_push(Type, JIDs, #xmlel{attrs = _, children = [#xmlel{name = Type, attrs = Attrs, children = Items}]}=Stanza) -> true = escalus_pred:is_iq_set(Stanza), {<<"xmlns">>, ?NS_BLOCKING} = lists:keyfind(<<"xmlns">>, 1, Attrs), diff --git a/big_tests/tests/mod_event_pusher_http_SUITE.erl b/big_tests/tests/mod_event_pusher_http_SUITE.erl index badd877bbb4..42751a4ccea 100644 --- a/big_tests/tests/mod_event_pusher_http_SUITE.erl +++ b/big_tests/tests/mod_event_pusher_http_SUITE.erl @@ -8,7 +8,7 @@ -module(mod_event_pusher_http_SUITE). -author("baibossynov.valery@gmail.com"). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). diff --git a/big_tests/tests/mod_global_distrib_SUITE.erl b/big_tests/tests/mod_global_distrib_SUITE.erl index 108280c03ed..2ac05456f58 100644 --- a/big_tests/tests/mod_global_distrib_SUITE.erl +++ b/big_tests/tests/mod_global_distrib_SUITE.erl @@ -16,7 +16,7 @@ -module(mod_global_distrib_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). @@ -983,7 +983,7 @@ disable_endpoint_on_refresh(Config) -> [] = Disabled1, [NewEndpoint] = Disabled2. -wait_for_connection(Config) -> +wait_for_connection(_Config) -> set_endpoints(asia_node, []), %% Because of hosts refresher, a pool of connections to asia_node %% may already be present here @@ -1202,7 +1202,7 @@ spawn_connection_getter(SenderNode) -> TestPid ! Conn end). -enable_extra_endpoint(ListenNode, SenderNode, Port, Config) -> +enable_extra_endpoint(ListenNode, SenderNode, Port, _Config) -> OriginalEndpoint = listen_endpoint(ListenNode), NewEndpoint = {{127, 0, 0, 1}, Port}, diff --git a/big_tests/tests/mod_ping_SUITE.erl b/big_tests/tests/mod_ping_SUITE.erl index ab812afdef0..5ade89925c5 100644 --- a/big_tests/tests/mod_ping_SUITE.erl +++ b/big_tests/tests/mod_ping_SUITE.erl @@ -14,7 +14,7 @@ %% limitations under the License. %%============================================================================== -module(mod_ping_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("escalus/include/escalus_xmlns.hrl"). diff --git a/big_tests/tests/mod_time_SUITE.erl b/big_tests/tests/mod_time_SUITE.erl index 8aa1aaee706..71e55218afa 100644 --- a/big_tests/tests/mod_time_SUITE.erl +++ b/big_tests/tests/mod_time_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(mod_time_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/big_tests/tests/mod_version_SUITE.erl b/big_tests/tests/mod_version_SUITE.erl index c4798d61d19..df02897d70e 100644 --- a/big_tests/tests/mod_version_SUITE.erl +++ b/big_tests/tests/mod_version_SUITE.erl @@ -1,5 +1,5 @@ -module(mod_version_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/big_tests/tests/mongoose_cassandra_SUITE.erl b/big_tests/tests/mongoose_cassandra_SUITE.erl index eddc800edcb..480161e1221 100644 --- a/big_tests/tests/mongoose_cassandra_SUITE.erl +++ b/big_tests/tests/mongoose_cassandra_SUITE.erl @@ -14,7 +14,7 @@ %%. -module(mongoose_cassandra_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). %% %%' Imports @@ -198,13 +198,13 @@ big_objects_read_write_should_succeed(Config) -> ok. -should_work_after_connection_reset(Config) -> +should_work_after_connection_reset(_Config) -> reset_all_cassandra_connections(), mongoose_helper:wait_until(fun() -> call(test_query, [?TEST_DB_POOL_NAME]) end, ok). -should_work_after_restart_of_cqerl_cluster(Config) -> +should_work_after_restart_of_cqerl_cluster(_Config) -> Pid1 = call(erlang, whereis, [cqerl_cluster]), call(erlang, exit, [Pid1, kill]), mongoose_helper:wait_until(fun() -> @@ -304,7 +304,7 @@ cql_read(Config, QueryName, Params) -> call(cql_read, cql_args(Config, [QueryName, Params])). int() -> - crypto:rand_uniform(0, 999999999). + rand:uniform(999999999). str(Bytes) -> erlang:list_to_binary( diff --git a/big_tests/tests/mongoose_elasticsearch_SUITE.erl b/big_tests/tests/mongoose_elasticsearch_SUITE.erl index a148945a838..a0f0a9e099c 100644 --- a/big_tests/tests/mongoose_elasticsearch_SUITE.erl +++ b/big_tests/tests/mongoose_elasticsearch_SUITE.erl @@ -14,7 +14,7 @@ -module(mongoose_elasticsearch_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/big_tests/tests/mongoose_sanity_checks_SUITE.erl b/big_tests/tests/mongoose_sanity_checks_SUITE.erl index e5a128d3f16..fdadc8d43de 100644 --- a/big_tests/tests/mongoose_sanity_checks_SUITE.erl +++ b/big_tests/tests/mongoose_sanity_checks_SUITE.erl @@ -1,6 +1,6 @@ -module(mongoose_sanity_checks_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). all() -> [is_mongooseim]. diff --git a/big_tests/tests/mongooseimctl_SUITE.erl b/big_tests/tests/mongooseimctl_SUITE.erl index edacda8bbf7..cebff250125 100644 --- a/big_tests/tests/mongooseimctl_SUITE.erl +++ b/big_tests/tests/mongooseimctl_SUITE.erl @@ -14,7 +14,7 @@ %% limitations under the License. %%============================================================================== -module(mongooseimctl_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all, nowarn_shadow_vars]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). @@ -1087,7 +1087,7 @@ stats_host(Config) -> simple_register(Config) -> %% given Domain = domain(), - {Name, Password} = {<<"tyler">>, <<"durden">>}, + {_, Password} = {<<"tyler">>, <<"durden">>}, %% when {R1, 0} = mongooseimctl("registered_users", [Domain], Config), Before = length(string:tokens(R1, "\n")), @@ -1292,8 +1292,7 @@ set_last(User, Domain, TStamp) -> rpc(mim(), mod_last, store_last_info, [host_type(), escalus_utils:jid_to_lower(User), Domain, TStamp, <<>>]). -delete_users(Config) -> - Users = escalus_users:get_users([alice, bob, kate, mike]), +delete_users(_Config) -> lists:foreach(fun({User, Domain}) -> JID = mongoose_helper:make_jid(User, Domain), rpc(mim(), ejabberd_auth, remove_user, [JID]) @@ -1351,10 +1350,10 @@ match_roster(ItemsValid, Items) -> ItemsTokens = [ string:tokens(ItemToken, "\t") || ItemToken <- string:tokens(Items, "\n") ], true = (length(ItemsValid) == length(ItemsTokens)), - true = lists:all(fun({Username, Domain, Nick, Group, Sub}) -> + true = lists:all(fun({Username, Domain, _Nick, _Group, _Sub}) -> JID = escalus_utils:jid_to_lower(<>), lists:any(fun - ([RosterJID, Nick, Sub, "none", Group]) -> + ([RosterJID, _Nick, _Sub, "none", _Group]) -> JID =:= escalus_utils:jid_to_lower(list_to_binary(RosterJID)); (_) -> false diff --git a/big_tests/tests/mongooseimctl_helper.erl b/big_tests/tests/mongooseimctl_helper.erl index 3ce4dff2a55..299f9ba83fb 100644 --- a/big_tests/tests/mongooseimctl_helper.erl +++ b/big_tests/tests/mongooseimctl_helper.erl @@ -9,7 +9,7 @@ -module(mongooseimctl_helper). -author("ludwikbukowski"). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). diff --git a/big_tests/tests/muc_SUITE.erl b/big_tests/tests/muc_SUITE.erl index e8e69a1fcee..42a158eb1ab 100644 --- a/big_tests/tests/muc_SUITE.erl +++ b/big_tests/tests/muc_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(muc_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("escalus/include/escalus_xmlns.hrl"). @@ -1512,7 +1512,7 @@ admin_member_list_allowed(ConfigIn) -> %% setup room - allow getmemberlist for moderator Form = stanza_configuration_form(?config(room, Config), [ {<<"muc#roomconfig_getmemberlist">>, [<<"moderator">>], <<"list-multi">>}]), - Result = escalus:send_iq_and_wait_for_result(Alice, Form), + escalus:send_iq_and_wait_for_result(Alice, Form), %% memberlist %% Alice - yes check_memberlist(Alice, yes, Config), @@ -1530,7 +1530,7 @@ admin_member_list_allowed(ConfigIn) -> %% setup room - allow getmemberlist for participant Form1 = stanza_configuration_form(?config(room, Config), [ {<<"muc#roomconfig_getmemberlist">>, [<<"participant">>], <<"list-multi">>}]), - Result1 = escalus:send_iq_and_wait_for_result(Alice, Form1), + escalus:send_iq_and_wait_for_result(Alice, Form1), %% memberlist %% Alice - yes check_memberlist(Alice, yes, Config), @@ -1560,7 +1560,7 @@ admin_member_list_allowed(ConfigIn) -> %% setup room - allow getmemberlist for visitor Form2 = stanza_configuration_form(?config(room, Config), [ {<<"muc#roomconfig_getmemberlist">>, [<<"visitor">>], <<"list-multi">>}]), - Result2 = escalus:send_iq_and_wait_for_result(Alice, Form2), + escalus:send_iq_and_wait_for_result(Alice, Form2), %% member list %% Alice - yes check_memberlist(Alice, yes, Config), @@ -1967,7 +1967,7 @@ admin_mo_invite_mere(ConfigIn) -> %Example 18 groupchat_user_enter(ConfigIn) -> UserSpecs = [{alice, 1}, {bob, 1}], - story_with_room(ConfigIn, [], UserSpecs, fun(Config, Alice, Bob) -> + story_with_room(ConfigIn, [], UserSpecs, fun(Config, _Alice, Bob) -> EnterRoomStanza = stanza_groupchat_enter_room(?config(room, Config), escalus_utils:get_username(Bob)), escalus:send(Bob, EnterRoomStanza), Presence = escalus:wait_for_stanza(Bob), @@ -2083,7 +2083,7 @@ deny_entry_to_a_banned_user(ConfigIn) -> %Examlpe 31 deny_entry_nick_conflict(ConfigIn) -> UserSpecs = [{alice, 1}, {bob, 1}, {kate, 1}], - story_with_room(ConfigIn, [], UserSpecs, fun(Config, Alice, Bob, Kate) -> + story_with_room(ConfigIn, [], UserSpecs, fun(Config, _Alice, Bob, Kate) -> EnterRoomStanza = stanza_muc_enter_room(?config(room, Config), escalus_utils:get_username(Bob)), escalus:send(Bob, EnterRoomStanza), escalus:wait_for_stanzas(Bob, 2), @@ -2465,7 +2465,7 @@ no_subject(ConfigIn)-> %Example 44, 45 send_to_all(ConfigIn) -> UserSpecs = [{alice, 1}, {bob, 1}, {kate, 1}], - story_with_room(ConfigIn, [], UserSpecs, fun(Config, Alice, Bob, Kate) -> + story_with_room(ConfigIn, [], UserSpecs, fun(Config, _Alice, Bob, Kate) -> escalus:send(Bob, stanza_muc_enter_room(?config(room, Config), escalus_utils:get_username(Bob))), escalus:wait_for_stanzas(Bob, 2), escalus:send(Kate, stanza_muc_enter_room(?config(room, Config), escalus_utils:get_username(Kate))), @@ -2484,7 +2484,7 @@ send_to_all(ConfigIn) -> %Examples 46, 47 send_and_receive_private_message(ConfigIn) -> UserSpecs = [{alice, 1}, {bob, 1}, {kate, 1}], - story_with_room(ConfigIn, [], UserSpecs, fun(Config, Alice, Bob, Kate) -> + story_with_room(ConfigIn, [], UserSpecs, fun(Config, _Alice, Bob, Kate) -> escalus:send(Bob, stanza_muc_enter_room(?config(room, Config), escalus_utils:get_username(Bob))), escalus:wait_for_stanzas(Bob, 2), escalus:send(Kate, stanza_muc_enter_room(?config(room, Config), escalus_utils:get_username(Kate))), @@ -2528,7 +2528,7 @@ send_private_groupchat(ConfigIn) -> % Fails - no 110 status code change_nickname(ConfigIn) -> UserSpecs = [{alice, 1}, {bob, 1}, {kate, 1}], - story_with_room(ConfigIn, [], UserSpecs, fun(Config, Alice, Bob, Kate) -> + story_with_room(ConfigIn, [], UserSpecs, fun(Config, _Alice, Bob, Kate) -> BobNick = escalus_utils:get_username(Bob), escalus:send(Bob, stanza_muc_enter_room(?config(room, Config), BobNick)), escalus:wait_for_stanzas(Bob, 2), @@ -2553,7 +2553,7 @@ change_nickname(ConfigIn) -> %Example 52 deny_nickname_change_conflict(ConfigIn) -> UserSpecs = [{alice, 1}, {bob, 1}, {kate, 1}], - story_with_room(ConfigIn, [], UserSpecs, fun(Config, Alice, Bob, Kate) -> + story_with_room(ConfigIn, [], UserSpecs, fun(Config, _Alice, Bob, Kate) -> escalus:send(Bob, stanza_muc_enter_room(?config(room, Config), <<"bob">>)), escalus:wait_for_stanzas(Bob, 2), escalus:send(Kate, stanza_muc_enter_room(?config(room, Config), <<"eve">>)), @@ -2934,7 +2934,7 @@ disco_items(Config) -> _Stanza = escalus:wait_for_stanza(Alice), %% works because the list is public - Stanza2 = escalus:send_iq_and_wait_for_result( + _Stanza2 = escalus:send_iq_and_wait_for_result( Bob, stanza_to_room(escalus_stanza:iq_get(?NS_DISCO_ITEMS,[]), <<"alicesroom">>)) end). @@ -3031,7 +3031,7 @@ create_instant_room(Config) -> escalus:wait_for_stanza(Alice), % topic - IQ = escalus:send_iq_and_wait_for_result(Alice, stanza_instant_room(RoomName)), + escalus:send_iq_and_wait_for_result(Alice, stanza_instant_room(RoomName)), %% Bob should be able to join the room escalus:send(Bob, stanza_muc_enter_room(RoomName, <<"bob">>)), @@ -3600,7 +3600,7 @@ owner_list(ConfigIn) -> owner_unauthorized(ConfigIn) -> RoomOpts = [{persistent, true}], UserSpecs = [{alice, 1}, {bob, 1}], - story_with_room(ConfigIn, RoomOpts, UserSpecs, fun(Config, Alice, Bob) -> + story_with_room(ConfigIn, RoomOpts, UserSpecs, fun(Config, _Alice, Bob) -> %% Bob joins room escalus:send(Bob, stanza_muc_enter_room(?config(room, Config), <<"bob">>)), escalus:wait_for_stanzas(Bob, 2), @@ -3802,7 +3802,7 @@ admin_list(ConfigIn) -> admin_unauthorized(ConfigIn) -> RoomOpts = [{persistent, true}], UserSpecs = [{alice, 1}, {bob, 1}], - story_with_room(ConfigIn, RoomOpts, UserSpecs, fun(Config, Alice, Bob) -> + story_with_room(ConfigIn, RoomOpts, UserSpecs, fun(Config, _Alice, Bob) -> %% Bob joins room escalus:send(Bob, stanza_muc_enter_room(?config(room, Config), <<"bob">>)), escalus:wait_for_stanzas(Bob, 2), @@ -4034,7 +4034,7 @@ create_instant_http_password_protected_room(Config) -> escalus:wait_for_stanza(Alice), % topic - IQ = escalus:send_iq_and_wait_for_result(Alice, stanza_instant_room(RoomName)), + escalus:send_iq_and_wait_for_result(Alice, stanza_instant_room(RoomName)), %% Bob should be able to join the room escalus:send(Bob, stanza_muc_enter_password_protected_room(RoomName, <<"bob">>, ?PASSWORD)), diff --git a/big_tests/tests/muc_helper.erl b/big_tests/tests/muc_helper.erl index 118e041009a..2a16dae56fc 100644 --- a/big_tests/tests/muc_helper.erl +++ b/big_tests/tests/muc_helper.erl @@ -1,5 +1,5 @@ -module(muc_helper). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("exml/include/exml.hrl"). @@ -249,7 +249,7 @@ stanza_get_features() -> escalus_stanza:setattr(escalus_stanza:iq_get(?NS_DISCO_INFO, []), <<"to">>, muc_host()). -has_features(#xmlel{children = [ Query ]} = Iq, Features) -> +has_features(#xmlel{children = [ Query ]} = _Iq, Features) -> %% end). disco_info(Config) -> - disco_features_story(Config, false). + disco_info_story(Config, false). disco_info_with_mam(Config) -> - disco_features_story(Config, true). + disco_info_story(Config, true). disco_info_story(Config, HasMAM) -> escalus:story(Config, [{alice, 1}], fun(Alice) -> - DiscoStanza = escalus_stanza:to(escalus_stanza:iq_get(?NS_DISCO_INFO, []), ?ROOM), + RoomJID = room_bin_jid(?ROOM), + DiscoStanza = escalus_stanza:to(escalus_stanza:iq_get(?NS_DISCO_INFO, []), RoomJID), escalus:send(Alice, DiscoStanza), Stanza = escalus:wait_for_stanza(Alice), check_features(Stanza, HasMAM), - escalus:assert(is_stanza_from, [?MUCHOST], Stanza) + escalus:assert(is_stanza_from, [RoomJID], Stanza) end). check_features(Stanza, HasMAM) -> diff --git a/big_tests/tests/muc_light_helper.erl b/big_tests/tests/muc_light_helper.erl index 8f1b1169ec6..948b59bc717 100644 --- a/big_tests/tests/muc_light_helper.erl +++ b/big_tests/tests/muc_light_helper.erl @@ -1,6 +1,6 @@ -module(muc_light_helper). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include("mam_helper.hrl"). -include("muc_light.hrl"). @@ -96,7 +96,7 @@ user_leave(Room, User, RemainingOccupants) -> verify_aff_bcast(RemainingOccupants, AffUsersChanges), escalus:assert(is_iq_result, escalus:wait_for_stanza(User)). -then_archive_response_is(Receiver, Expected, Config) -> +then_archive_response_is(Receiver, Expected, _Config) -> Response = mam_helper:wait_archive_respond(Receiver), Stanzas = mam_helper:respond_messages(mam_helper:assert_respond_size(length(Expected), Response)), ParsedStanzas = [ mam_helper:parse_forwarded_message(Stanza) || Stanza <- Stanzas ], diff --git a/big_tests/tests/muc_light_http_api_SUITE.erl b/big_tests/tests/muc_light_http_api_SUITE.erl index ac9df9a3b87..da218f45412 100644 --- a/big_tests/tests/muc_light_http_api_SUITE.erl +++ b/big_tests/tests/muc_light_http_api_SUITE.erl @@ -18,7 +18,7 @@ %%============================================================================== -module(muc_light_http_api_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). @@ -276,9 +276,8 @@ member_is_affiliated(Stanza, User) -> Data = exml_query:path(Stanza, [{element, <<"x">>}, {element, <<"user">>}, cdata]), MemberJID == Data. -check_delete_room(Config, RoomNameToCreate, RoomNameToDelete, RoomOwner, +check_delete_room(_Config, RoomNameToCreate, RoomNameToDelete, RoomOwner, RoomMembers, UserToExecuteDelete) -> - Domain = muc_light_domain(), Members = [{Member, member} || Member <- RoomMembers], escalus:send(RoomOwner, stanza_create_room(undefined, [{<<"roomname">>, RoomNameToCreate}], diff --git a/big_tests/tests/muc_light_legacy_SUITE.erl b/big_tests/tests/muc_light_legacy_SUITE.erl index a3404c9c58d..61c4c84a5c7 100644 --- a/big_tests/tests/muc_light_legacy_SUITE.erl +++ b/big_tests/tests/muc_light_legacy_SUITE.erl @@ -880,10 +880,3 @@ set_default_mod_config() -> -spec room_bin_jid(Room :: binary()) -> binary(). room_bin_jid(Room) -> <>. - -disco_disabled() -> - try - ct:get_config({disable_disco_tests}) - catch _:_ -> - false - end. diff --git a/big_tests/tests/oauth_SUITE.erl b/big_tests/tests/oauth_SUITE.erl index 218fe2ad4cf..edbe92942ba 100644 --- a/big_tests/tests/oauth_SUITE.erl +++ b/big_tests/tests/oauth_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(oauth_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("escalus/include/escalus_xmlns.hrl"). @@ -254,7 +254,7 @@ login_refresh_token_impl(Config, {_AccessToken, RefreshToken}) -> {ok, ClientConnection = #client{props = Props}, _Features} = escalus_connection:start(BobSpec, ConnSteps), Props2 = lists:keystore(oauth_token, 1, Props, {oauth_token, RefreshToken}), - AuthResultToken = (catch escalus_auth:auth_sasl_oauth(ClientConnection, Props2)), + (catch escalus_auth:auth_sasl_oauth(ClientConnection, Props2)), ok. %% users logs in using access token he obtained in previous session (stream has been diff --git a/big_tests/tests/offline_SUITE.erl b/big_tests/tests/offline_SUITE.erl index 3142598f13a..fe7bd59695d 100644 --- a/big_tests/tests/offline_SUITE.erl +++ b/big_tests/tests/offline_SUITE.erl @@ -5,7 +5,7 @@ %%%=================================================================== -module(offline_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). diff --git a/big_tests/tests/offline_stub_SUITE.erl b/big_tests/tests/offline_stub_SUITE.erl index 7abe27ae1c5..321c0567c01 100644 --- a/big_tests/tests/offline_stub_SUITE.erl +++ b/big_tests/tests/offline_stub_SUITE.erl @@ -1,5 +1,5 @@ -module(offline_stub_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). %%%=================================================================== %%% Suite configuration diff --git a/big_tests/tests/path_helper.erl b/big_tests/tests/path_helper.erl index 9e3ac374dd1..0ff04407211 100644 --- a/big_tests/tests/path_helper.erl +++ b/big_tests/tests/path_helper.erl @@ -11,11 +11,11 @@ -export([canonicalize_path/1]). %% @doc Get repository root directory -repo_dir(Config) -> +repo_dir(_Config) -> get_env_var("REPO_DIR"). %% @doc Get `big_tests/' directory -test_dir(Config) -> +test_dir(_Config) -> get_env_var("TEST_DIR"). %% @doc Returns`big_tests/ct_report/ct_run.*' directory @@ -23,11 +23,11 @@ test_dir(Config) -> ct_run_dir(Config) -> PrivDir = proplists:get_value(priv_dir, Config), %% Remove: *SUITE.logs/run.*/log_private/ - RunDir = path_helper:test_dir(Config), + _RunDir = path_helper:test_dir(Config), filename:absname(filename:join([PrivDir, "..", "..", ".."])). %% @doc Returns path, corresponding to `ct_run_dir' in browser -ct_run_dir_in_browser(Config) -> +ct_run_dir_in_browser(_Config) -> "../..". %% @doc Unsafe version of `filename:safe_relative_path/1' diff --git a/big_tests/tests/presence_SUITE.erl b/big_tests/tests/presence_SUITE.erl index 4d6eb9040dc..963d11c5d41 100644 --- a/big_tests/tests/presence_SUITE.erl +++ b/big_tests/tests/presence_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(presence_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). @@ -567,7 +567,7 @@ subscribe_preserves_extra_info(Config) -> escalus:send(Alice, escalus_stanza:iq_result(PushReq)), Received = escalus:wait_for_stanza(Bob), escalus:assert(is_presence_with_type, [<<"subscribe">>], Received), - + %% Alice gets current roster escalus:send(Alice, escalus_stanza:roster_get()), RosterResult = escalus:wait_for_stanza(Alice), @@ -575,7 +575,7 @@ subscribe_preserves_extra_info(Config) -> %% Actual verification [BobItem] = exml_query:paths(RosterResult, [{element, <<"query">>}, {element, <<"item">>}]), - + ValidName = bobs_default_name(), ValidGroups = lists:sort(bobs_default_groups()), diff --git a/big_tests/tests/privacy_SUITE.erl b/big_tests/tests/privacy_SUITE.erl index 710e2201f20..39b188225d0 100644 --- a/big_tests/tests/privacy_SUITE.erl +++ b/big_tests/tests/privacy_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(privacy_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("exml/include/exml.hrl"). -include_lib("escalus/include/escalus.hrl"). diff --git a/big_tests/tests/private_SUITE.erl b/big_tests/tests/private_SUITE.erl index 87ef84f3faf..832e7009c7d 100644 --- a/big_tests/tests/private_SUITE.erl +++ b/big_tests/tests/private_SUITE.erl @@ -14,7 +14,7 @@ %% limitations under the License. %%============================================================================== -module(private_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("exml/include/exml.hrl"). -include_lib("escalus/include/escalus.hrl"). diff --git a/big_tests/tests/push_SUITE.erl b/big_tests/tests/push_SUITE.erl index be3b5c79ffb..b0aacb62f4b 100644 --- a/big_tests/tests/push_SUITE.erl +++ b/big_tests/tests/push_SUITE.erl @@ -1,5 +1,5 @@ -module(push_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). @@ -402,10 +402,10 @@ disable_all_nodes_removes_it_from_all_user_session_infos(Config) -> escalus:assert(is_iq_result, escalus:wait_for_stanza(Bob2)), Info = mongoose_helper:get_session_info(?RPC_SPEC, Bob1), - {_JID, NodeId, _} = maps:get(?SESSION_KEY, Info), + {JID, NodeId, _} = maps:get(?SESSION_KEY, Info), Info2 = mongoose_helper:get_session_info(?RPC_SPEC, Bob2), - {_JID, NodeId2, _} = maps:get(?SESSION_KEY, Info2), + {JID, NodeId2, _} = maps:get(?SESSION_KEY, Info2), %% Now Bob1 disables all nodes escalus:send(Bob1, disable_stanza(PubsubJID)), @@ -434,10 +434,10 @@ disable_node_enabled_in_other_session_leaves_current_info_unchanged(Config) -> escalus:assert(is_iq_result, escalus:wait_for_stanza(Bob2)), Info = mongoose_helper:get_session_info(?RPC_SPEC, Bob1), - {_JID, NodeId, _} = maps:get(?SESSION_KEY, Info), + {JID, NodeId, _} = maps:get(?SESSION_KEY, Info), Info2 = mongoose_helper:get_session_info(?RPC_SPEC, Bob2), - {_JID, NodeId2, _} = maps:get(?SESSION_KEY, Info2), + {JID, NodeId2, _} = maps:get(?SESSION_KEY, Info2), %% Now Bob1 disables the node registered by Bob2 escalus:send(Bob1, disable_stanza(PubsubJID, NodeId)), diff --git a/big_tests/tests/push_http_SUITE.erl b/big_tests/tests/push_http_SUITE.erl index 56a52be739d..b70a90354c5 100644 --- a/big_tests/tests/push_http_SUITE.erl +++ b/big_tests/tests/push_http_SUITE.erl @@ -1,5 +1,5 @@ -module(push_http_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("exml/include/exml.hrl"). -include_lib("escalus/include/escalus.hrl"). diff --git a/big_tests/tests/push_integration_SUITE.erl b/big_tests/tests/push_integration_SUITE.erl index 6f22851f864..d3d6db7e2f9 100644 --- a/big_tests/tests/push_integration_SUITE.erl +++ b/big_tests/tests/push_integration_SUITE.erl @@ -1,5 +1,5 @@ -module(push_integration_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/big_tests/tests/push_pubsub_SUITE.erl b/big_tests/tests/push_pubsub_SUITE.erl index bacb0a60c68..e6477a78f78 100644 --- a/big_tests/tests/push_pubsub_SUITE.erl +++ b/big_tests/tests/push_pubsub_SUITE.erl @@ -1,5 +1,5 @@ -module(push_pubsub_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/big_tests/tests/race_conditions_SUITE.erl b/big_tests/tests/race_conditions_SUITE.erl index 334d96671e0..b07990f3b6b 100644 --- a/big_tests/tests/race_conditions_SUITE.erl +++ b/big_tests/tests/race_conditions_SUITE.erl @@ -14,7 +14,7 @@ %% limitations under the License. %%============================================================================== -module(race_conditions_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -export([handle_delayiq_iq/5]). diff --git a/big_tests/tests/rdbms_SUITE.erl b/big_tests/tests/rdbms_SUITE.erl index cc4de8bc7a1..0356ae3cefc 100644 --- a/big_tests/tests/rdbms_SUITE.erl +++ b/big_tests/tests/rdbms_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(rdbms_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). @@ -603,18 +603,18 @@ selected_boolean_to_binary_int(_Config, Other) -> boolean_to_binary_int(true) -> <<"1">>; boolean_to_binary_int(false) -> <<"0">>. -maybe_selected_length(Config, {selected, [{Value}]}) when is_binary(Value) -> +maybe_selected_length(_Config, {selected, [{Value}]}) when is_binary(Value) -> byte_size(Value); -maybe_selected_length(_Config, Other) -> +maybe_selected_length(_Config, _Other) -> unknown. maybe_selected_tail(Config, Selected) -> maybe_selected_tail(Config, Selected, 100). -maybe_selected_tail(Config, {selected, [{Value}]}, TailLen) +maybe_selected_tail(_Config, {selected, [{Value}]}, TailLen) when is_binary(Value), byte_size(Value) > TailLen -> binary:part(Value, {byte_size(Value), -TailLen}); -maybe_selected_tail(Config, {selected, [{Value}]}, _TailLen) -> +maybe_selected_tail(_Config, {selected, [{Value}]}, _TailLen) -> Value; maybe_selected_tail(_Config, _Other, _TailLen) -> unknown. @@ -791,7 +791,7 @@ check_like_matching(Config, TextValue, Matching, Info) -> select_query => SelectQuery, select_result => SelectResult}). -check_like_not_matching(Config, TextValue, NotMatching, Info) -> +check_like_not_matching(Config, _TextValue, NotMatching, Info) -> SLike = escape_like(Config, NotMatching), SelectQuery = ["SELECT unicode FROM test_types " "WHERE unicode LIKE ", use_escaped_like(Config, SLike)], @@ -803,7 +803,7 @@ check_like_not_matching(Config, TextValue, NotMatching, Info) -> select_query => SelectQuery, select_result => SelectResult}). -compare_selected(Config, {selected, [{SelValue}]}, Value) -> +compare_selected(_Config, {selected, [{SelValue}]}, Value) -> drop_common_prefix(0, SelValue, Value); compare_selected(_Config, _, _Value) -> nomatch. diff --git a/big_tests/tests/rest_SUITE.erl b/big_tests/tests/rest_SUITE.erl index b92312a7331..746100da336 100644 --- a/big_tests/tests/rest_SUITE.erl +++ b/big_tests/tests/rest_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(rest_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). @@ -194,9 +194,9 @@ auth_always_passes_blank_creds(_Config) -> % we set control creds for blank rest_helper:change_admin_creds(any), % try with any auth - {?OK, _Lcmds} = gett(admin, <<"/commands">>, {<<"aaaa">>, <<"bbbb">>}), + {?OK, Lcmds} = gett(admin, <<"/commands">>, {<<"aaaa">>, <<"bbbb">>}), % try with no auth - {?OK, _Lcmds} = gett(admin, <<"/commands">>). + {?OK, Lcmds} = gett(admin, <<"/commands">>). commands_are_listed(_C) -> {?OK, Lcmds} = gett(admin, <<"/commands">>), diff --git a/big_tests/tests/rest_client_SUITE.erl b/big_tests/tests/rest_client_SUITE.erl index 58e1f251bfb..3eccc1ea961 100644 --- a/big_tests/tests/rest_client_SUITE.erl +++ b/big_tests/tests/rest_client_SUITE.erl @@ -1,5 +1,5 @@ -module(rest_client_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("eunit/include/eunit.hrl"). @@ -152,7 +152,7 @@ init_per_group(_GN, C) -> end_per_group(_GN, C) -> C. -init_per_testcase(config_can_be_changed_by_all = CaseName, Config) -> +init_per_testcase(config_can_be_changed_by_all, Config) -> DefaultConfig = dynamic_modules:save_modules(host_type(), Config), set_mod_config(all_can_configure, true, config_to_muc_host(Config)), escalus:init_per_testcase(config_can_be_changed_by_all, DefaultConfig); @@ -180,7 +180,7 @@ init_per_testcase(TC, Config) -> ], rest_helper:maybe_skip_mam_test_cases(TC, MAMTestCases, Config). -end_per_testcase(config_can_be_changed_by_all = CaseName, Config) -> +end_per_testcase(config_can_be_changed_by_all, Config) -> set_mod_config(all_can_configure, false, config_to_muc_host(Config)), dynamic_modules:restore_modules(host_type(), Config), escalus:end_per_testcase(config_can_be_changed_by_all, Config); @@ -456,7 +456,7 @@ sending_message_not_in_JSON_results_in_bad_request(Config) -> messages_are_archived_in_room(Config) -> escalus:fresh_story(Config, [{alice, 1}, {bob, 1}], fun(Alice, Bob) -> - {RoomID, Msgs} = given_new_room_with_users_and_msgs({alice, Alice}, [{bob, Bob}]), + {RoomID, _Msgs} = given_new_room_with_users_and_msgs({alice, Alice}, [{bob, Bob}]), mam_helper:maybe_wait_for_archive(Config), {{<<"200">>, <<"OK">>}, Result} = get_room_messages({alice, Alice}, RoomID), [Aff, _Msg1, _Msg2] = rest_helper:decode_maplist(Result), @@ -525,7 +525,7 @@ get_room_messages(Caller, RoomID) -> messages_can_be_paginated_in_room(Config) -> escalus:fresh_story(Config, [{alice, 1}, {bob, 1}], fun(Alice, Bob) -> RoomID = given_new_room_with_users({alice, Alice}, [{bob, Bob}]), - [GenMsgs1, GenMsgs2 | _] = Msgs = rest_helper:fill_room_archive(RoomID, [Alice, Bob]), + [GenMsgs1, GenMsgs2 | _] = rest_helper:fill_room_archive(RoomID, [Alice, Bob]), mam_helper:maybe_wait_for_archive(Config), Msgs10 = get_room_messages({alice, Alice}, RoomID, 10), Msgs10Len = length(Msgs10), @@ -571,7 +571,7 @@ room_can_be_fetched_by_jid(Config) -> end). messages_can_be_sent_and_fetched_by_room_jid(Config) -> - escalus:fresh_story(Config, [{alice, 1}, {bob, 1}], fun(Alice, Bob) -> + escalus:fresh_story(Config, [{alice, 1}, {bob, 1}], fun(Alice, _Bob) -> RoomID = given_new_room({alice, Alice}), RoomJID = room_jid(RoomID, Config), given_message_sent_to_room(RoomJID, {alice, Alice}), @@ -661,7 +661,7 @@ msg_with_malformed_props_can_be_parsed(Config) -> % recent msgs with a limit M2 = get_messages_with_props(AliceCreds, BobJID, 1), - Recv = [_Msg] = rest_helper:decode_maplist(M2), + [_Msg] = rest_helper:decode_maplist(M2), MsgID = maps:get(id, _Msg) @@ -764,7 +764,7 @@ msg_without_thread_can_be_parsed(Config) -> mam_helper:wait_for_archive_size(Alice, 1), % recent msgs with a limit M2 = get_messages_with_props(AliceCreds, BobJID, 1), - Recv = [_Msg] = rest_helper:decode_maplist(M2), + [_Msg] = rest_helper:decode_maplist(M2), MsgID = maps:get(id, _Msg) end). @@ -1027,7 +1027,7 @@ connect_to_sse(User) -> wait_for_event(#{pid := Pid, stream_ref := StreamRef} = Opts) -> case gun:await(Pid, StreamRef) of - {response, nofin, Status, _} -> + {response, nofin, _Status, _} -> wait_for_event(Opts); {sse, #{data := [Response]}} -> Opts#{data => Response}; @@ -1245,8 +1245,8 @@ add_and_remove_some_contacts_properly(Config) -> escalus_client:short_jid(Kate)), MikeJID = escalus_utils:jid_to_lower( escalus_client:short_jid(Mike)), - AliceContact = create_contact(AliceJID), - KateContact = create_contact(KateJID), + _AliceContact = create_contact(AliceJID), + _KateContact = create_contact(KateJID), MikeContact = create_contact(MikeJID), % delete Alice and Kate Body = jiffy:encode(#{<<"to_delete">> => [AliceJID, KateJID]}), @@ -1276,9 +1276,9 @@ add_and_remove_some_contacts_with_nonexisting(Config) -> escalus_client:short_jid(Kate)), MikeJID = escalus_utils:jid_to_lower( escalus_client:short_jid(Mike)), - AliceContact = create_contact(AliceJID), - KateContact = create_contact(KateJID), - MikeContact = create_contact(MikeJID), + _AliceContact = create_contact(AliceJID), + _KateContact = create_contact(KateJID), + _MikeContact = create_contact(MikeJID), % delete Alice, Kate and Mike (who is absent) Body = jiffy:encode(#{<<"to_delete">> => [AliceJID, KateJID, MikeJID]}), {?OK, {[{<<"not_deleted">>,[MikeJID]}]}} = delete(client, "/contacts", BCred, Body), diff --git a/big_tests/tests/rest_helper.erl b/big_tests/tests/rest_helper.erl index c10826a2d1b..27812ff1095 100644 --- a/big_tests/tests/rest_helper.erl +++ b/big_tests/tests/rest_helper.erl @@ -206,9 +206,6 @@ fusco_request(#{ method := Method, path := Path, body := Body, port := Port} = P fusco_request(#{ role := Role, method := Method, path := Path, body := Body, server := Server } = Params) -> fusco_request(Method, Path, Body, [], get_port(Role, Server, Params), get_ssl_status(Role, Server), Params). -fusco_request(Method, Path, Body, HeadersIn, Port, SSL) -> - fusco_request(Method, Path, Body, HeadersIn, Port, SSL, #{}). - fusco_request(Method, Path, Body, HeadersIn, Port, SSL, Params) -> {ok, Client} = fusco_cp:start_link({"localhost", Port, SSL}, [], 1), Headers = [{<<"Content-Type">>, <<"application/json">>}, @@ -222,7 +219,7 @@ random_request_id() -> base16:encode(crypto:strong_rand_bytes(8)). report_errors(Client, Path, Method, Headers, Body, - {{CodeBin, _} = RCode, _RHeaders, _RBody, _, _} = Result, + {{CodeBin, _}, _RHeaders, _RBody, _, _} = Result, Params) -> Code = binary_to_integer(CodeBin), case Code >= 400 of @@ -250,7 +247,7 @@ report_errors(Client, Path, Method, Headers, Body, -spec get_port(Role :: role(), Server :: distributed_helper:rpc_spec(), map()) -> Port :: integer(). get_port(_Role, _Node, #{port := Port}) -> Port; -get_port(Role, Node, Params) -> +get_port(Role, Node, _Params) -> Listeners = rpc(Node, ejabberd_config, get_local_option, [listen]), [{PortIpNet, ejabberd_cowboy, _Opts}] = lists:filter(fun(Config) -> is_roles_config(Config, Role) end, Listeners), diff --git a/big_tests/tests/s2s_SUITE.erl b/big_tests/tests/s2s_SUITE.erl index 46ab6353304..1221b5ddd76 100644 --- a/big_tests/tests/s2s_SUITE.erl +++ b/big_tests/tests/s2s_SUITE.erl @@ -5,7 +5,7 @@ %%%=================================================================== -module(s2s_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("exml/include/exml.hrl"). diff --git a/big_tests/tests/sasl_SUITE.erl b/big_tests/tests/sasl_SUITE.erl index 959cf654d4c..8a79bff52c3 100644 --- a/big_tests/tests/sasl_SUITE.erl +++ b/big_tests/tests/sasl_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(sasl_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). diff --git a/big_tests/tests/sasl_external_SUITE.erl b/big_tests/tests/sasl_external_SUITE.erl index 4f12b37cca6..02879e10a1c 100644 --- a/big_tests/tests/sasl_external_SUITE.erl +++ b/big_tests/tests/sasl_external_SUITE.erl @@ -1,6 +1,6 @@ -module(sasl_external_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). @@ -396,7 +396,7 @@ generate_ca_signed_cert(C, User, UserConfig, UserKey ) -> UserCsr = filename:join(?config(priv_dir, C), User ++ ".csr"), Cmd = ["openssl req -config ", UserConfig, " -newkey rsa:2048 -sha256 -nodes -out ", UserCsr, " -keyout ", UserKey, " -outform PEM"], - Out = os:cmd(Cmd), + _Out = os:cmd(Cmd), UserCert = filename:join(?config(priv_dir, C), User ++ "_cert.pem"), SignCmd = filename:join(?config(mim_data_dir, C), "sign_cert.sh"), Cmd2 = [SignCmd, " --req ", UserCsr, " --out ", UserCert], diff --git a/big_tests/tests/service_domain_db_SUITE.erl b/big_tests/tests/service_domain_db_SUITE.erl index 0221062bffb..7139d74886a 100644 --- a/big_tests/tests/service_domain_db_SUITE.erl +++ b/big_tests/tests/service_domain_db_SUITE.erl @@ -3,7 +3,7 @@ -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). --compile(export_all). +-compile([export_all, nowarn_export_all]). -import(distributed_helper, [mim/0, mim2/0, require_rpc_nodes/1, rpc/4]). -import(mongooseimctl_helper, [mongooseimctl/3]). diff --git a/big_tests/tests/shared_roster_SUITE.erl b/big_tests/tests/shared_roster_SUITE.erl index 80594876bcc..2f38cdb9e72 100644 --- a/big_tests/tests/shared_roster_SUITE.erl +++ b/big_tests/tests/shared_roster_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(shared_roster_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("escalus/include/escalus_xmlns.hrl"). diff --git a/big_tests/tests/sic_SUITE.erl b/big_tests/tests/sic_SUITE.erl index 89664437456..65bd331d82d 100644 --- a/big_tests/tests/sic_SUITE.erl +++ b/big_tests/tests/sic_SUITE.erl @@ -5,7 +5,7 @@ %%%=================================================================== -module(sic_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). diff --git a/big_tests/tests/sm_SUITE.erl b/big_tests/tests/sm_SUITE.erl index bfb24245bbf..87d99e1378f 100644 --- a/big_tests/tests/sm_SUITE.erl +++ b/big_tests/tests/sm_SUITE.erl @@ -1,5 +1,5 @@ -module(sm_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("exml/include/exml.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/big_tests/tests/users_api_SUITE.erl b/big_tests/tests/users_api_SUITE.erl index 029a7b341c4..7adde08a8ac 100644 --- a/big_tests/tests/users_api_SUITE.erl +++ b/big_tests/tests/users_api_SUITE.erl @@ -14,7 +14,7 @@ %% limitations under the License. %%============================================================================== -module(users_api_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("eunit/include/eunit.hrl"). diff --git a/big_tests/tests/vcard_SUITE.erl b/big_tests/tests/vcard_SUITE.erl index 6253c80feca..132bd4c9607 100644 --- a/big_tests/tests/vcard_SUITE.erl +++ b/big_tests/tests/vcard_SUITE.erl @@ -26,7 +26,7 @@ %%============================================================================== -module(vcard_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("escalus/include/escalus_xmlns.hrl"). @@ -439,7 +439,7 @@ search_some(Config) -> AliceJID = <<"alice@", Domain/binary>>, %% Extra check - Result = escalus:send_and_wait(Client, escalus_stanza:vcard_request(AliceJID)), + _Result = escalus:send_and_wait(Client, escalus_stanza:vcard_request(AliceJID)), [{AliceJID, ItemTups}] = search_result_item_tuples(Res), {_, _, <<"City">>, MoscowRUBin} = lists:keyfind(<<"City">>, 3, ItemTups) @@ -1156,7 +1156,7 @@ prepare_vcard_module(Config) -> %% Keep the old config, so we can undo our changes, once finished testing Config1 = dynamic_modules:save_modules_for_host_types(host_types(), Config), %% Get a list of options, we can use as a prototype to start new modules - HostType = domain_helper:host_type(), + _HostType = domain_helper:host_type(), VCardOpts = dynamic_modules:get_saved_config(host_type(), mod_vcard, Config1), [{mod_vcard_opts, VCardOpts} | Config1]. diff --git a/big_tests/tests/vcard_simple_SUITE.erl b/big_tests/tests/vcard_simple_SUITE.erl index 21bd6e591c1..fd9c3df0ece 100644 --- a/big_tests/tests/vcard_simple_SUITE.erl +++ b/big_tests/tests/vcard_simple_SUITE.erl @@ -18,7 +18,7 @@ %%============================================================================== -module(vcard_simple_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus_xmlns.hrl"). -include_lib("escalus/include/escalus.hrl"). @@ -469,7 +469,6 @@ prepare_vcard_module(Config) -> %% Keep the old config, so we can undo our changes, once finished testing Config1 = dynamic_modules:save_modules_for_host_types(host_types(), Config), %% Get a list of options, we can use as a prototype to start new modules - HostType = domain_helper:host_type(), VCardOpts = dynamic_modules:get_saved_config(host_type(), mod_vcard, Config1), [{mod_vcard_opts, VCardOpts} | Config1]. diff --git a/big_tests/tests/vcard_update.erl b/big_tests/tests/vcard_update.erl index 444c0d89f7f..ee70ee44111 100644 --- a/big_tests/tests/vcard_update.erl +++ b/big_tests/tests/vcard_update.erl @@ -1,5 +1,5 @@ -module(vcard_update). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("exml/include/exml.hrl"). -include_lib("escalus/include/escalus.hrl"). diff --git a/big_tests/tests/websockets_SUITE.erl b/big_tests/tests/websockets_SUITE.erl index 66a50d2511d..c6c6d39872e 100644 --- a/big_tests/tests/websockets_SUITE.erl +++ b/big_tests/tests/websockets_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(websockets_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("escalus/include/escalus.hrl"). -include_lib("common_test/include/ct.hrl"). diff --git a/big_tests/tests/xep_0352_csi_SUITE.erl b/big_tests/tests/xep_0352_csi_SUITE.erl index 922fabbf4a1..c0f162e3bd9 100644 --- a/big_tests/tests/xep_0352_csi_SUITE.erl +++ b/big_tests/tests/xep_0352_csi_SUITE.erl @@ -3,7 +3,7 @@ -include_lib("exml/include/exml.hrl"). -include_lib("escalus/include/escalus.hrl"). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -import(domain_helper, [host_type/0]). diff --git a/elvis.config b/elvis.config index 95d80709379..48cf73b8611 100644 --- a/elvis.config +++ b/elvis.config @@ -11,7 +11,7 @@ {elvis_style, dont_repeat_yourself, #{min_complexity => 20}} ] }, - #{dirs => ["test", "test.disabled/ejabberd_tests/tests"], + #{dirs => ["test", "test.disabled/mongoose_tests/tests"], filter => "*.erl", ruleset => erl_files, rules => [{elvis_style, line_length, #{limit => 100, diff --git a/src/ejabberd_router.erl b/src/ejabberd_router.erl index a3a02785c0e..639da6879e4 100644 --- a/src/ejabberd_router.erl +++ b/src/ejabberd_router.erl @@ -534,7 +534,7 @@ default_routing_modules() -> make_routing_module_source(Mods) -> binary_to_list(iolist_to_binary(io_lib:format( "-module(mod_routing_machine).~n" - "-compile(export_all).~n" + "-compile([export_all, nowarn_export_all]).~n" "get_routing_module_list() -> ~p.~n", [Mods]))). diff --git a/src/mam/mod_mam_cassandra_arch.erl b/src/mam/mod_mam_cassandra_arch.erl index 2fdddbdca0a..4ab61a7b607 100644 --- a/src/mam/mod_mam_cassandra_arch.erl +++ b/src/mam/mod_mam_cassandra_arch.erl @@ -792,7 +792,7 @@ simple_params() -> params_helper(Params) -> binary_to_list(iolist_to_binary(io_lib:format( "-module(mod_mam_cassandra_arch_params).~n" - "-compile(export_all).~n" + "-compile([export_all, nowarn_export_all]).~n" "db_message_format() -> ~p.~n" "pool_name() -> ~p.~n", [proplists:get_value(db_message_format, Params, diff --git a/src/mam/mod_mam_cassandra_prefs.erl b/src/mam/mod_mam_cassandra_prefs.erl index 3f86fd5445c..6805cd7bf50 100644 --- a/src/mam/mod_mam_cassandra_prefs.erl +++ b/src/mam/mod_mam_cassandra_prefs.erl @@ -277,7 +277,7 @@ compile_params_module(Params) -> params_helper(Params) -> binary_to_list(iolist_to_binary(io_lib:format( "-module(mod_mam_cassandra_prefs_params).~n" - "-compile(export_all).~n" + "-compile([export_all, nowarn_export_all]).~n" "pool_name() -> ~p.~n", [proplists:get_value(pool_name, Params, default) ]))). diff --git a/src/mam/mod_mam_muc_cassandra_arch.erl b/src/mam/mod_mam_muc_cassandra_arch.erl index ea1118c79ff..bf1d2b0f42a 100644 --- a/src/mam/mod_mam_muc_cassandra_arch.erl +++ b/src/mam/mod_mam_muc_cassandra_arch.erl @@ -796,7 +796,7 @@ simple_params() -> params_helper(Params) -> binary_to_list(iolist_to_binary(io_lib:format( "-module(mod_mam_muc_cassandra_arch_params).~n" - "-compile(export_all).~n" + "-compile([export_all, nowarn_export_all]).~n" "db_message_format() -> ~p.~n" "pool_name() -> ~p.~n", [proplists:get_value(db_message_format, Params, diff --git a/src/mongoose_xmpp_errors.erl b/src/mongoose_xmpp_errors.erl index c3b0706b7fd..8b305338a1b 100644 --- a/src/mongoose_xmpp_errors.erl +++ b/src/mongoose_xmpp_errors.erl @@ -9,7 +9,7 @@ -author("Alex"). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include("mongoose_ns.hrl"). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/test/acc_SUITE.erl b/test/acc_SUITE.erl index 4673c443c32..7449cdc933f 100644 --- a/test/acc_SUITE.erl +++ b/test/acc_SUITE.erl @@ -1,6 +1,6 @@ %% @doc This suite tests API of accumulator encapsulated in mongoose_acc module -module(acc_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("exml/include/exml.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/acl_SUITE.erl b/test/acl_SUITE.erl index 2a2c9a1fe5a..769befca103 100644 --- a/test/acl_SUITE.erl +++ b/test/acl_SUITE.erl @@ -1,5 +1,5 @@ -module(acl_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("proper/include/proper.hrl"). diff --git a/test/amp_SUITE.erl b/test/amp_SUITE.erl index 364dca845bc..327d39de329 100644 --- a/test/amp_SUITE.erl +++ b/test/amp_SUITE.erl @@ -1,5 +1,5 @@ -module(amp_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). %% @doc Tests for XEP-0079 -related functions -include("amp.hrl"). diff --git a/test/amp_gen.erl b/test/amp_gen.erl index ca1a26a3f54..c1aae0dabd4 100644 --- a/test/amp_gen.erl +++ b/test/amp_gen.erl @@ -1,6 +1,6 @@ -module(amp_gen). %% Generators for XEP-0079 models --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include("amp.hrl"). -include_lib("proper/include/proper.hrl"). diff --git a/test/amp_resolver_SUITE.erl b/test/amp_resolver_SUITE.erl index b6cce814195..63c9199c248 100644 --- a/test/amp_resolver_SUITE.erl +++ b/test/amp_resolver_SUITE.erl @@ -6,7 +6,7 @@ %% @copyright 2014 Erlang Solutions, Ltd. %% This work was sponsored by Grindr LLC --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include("amp.hrl"). -include_lib("exml/include/exml.hrl"). diff --git a/test/async_helper.erl b/test/async_helper.erl index 43a52bce08b..fac7ef71311 100644 --- a/test/async_helper.erl +++ b/test/async_helper.erl @@ -1,5 +1,5 @@ -module(async_helper). --compile([export_all]). +-compile([export_all, nowarn_export_all]). start(Config, M, F, A) -> {ok, P} = start(M, F, A), diff --git a/test/auth_dummy_SUITE.erl b/test/auth_dummy_SUITE.erl index a1032f6cdae..e27d140d676 100644 --- a/test/auth_dummy_SUITE.erl +++ b/test/auth_dummy_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(auth_dummy_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -author('kacper.mentel@erlang-solutions.com'). -include_lib("common_test/include/ct.hrl"). diff --git a/test/auth_external_SUITE.erl b/test/auth_external_SUITE.erl index 7916976d02f..9e9e05ef55b 100644 --- a/test/auth_external_SUITE.erl +++ b/test/auth_external_SUITE.erl @@ -1,6 +1,6 @@ -module(auth_external_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). diff --git a/test/auth_http_SUITE.erl b/test/auth_http_SUITE.erl index a5bca799402..830f698ddf5 100644 --- a/test/auth_http_SUITE.erl +++ b/test/auth_http_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(auth_http_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -author('piotr.nosek@erlang-solutions.com'). -include_lib("common_test/include/ct.hrl"). diff --git a/test/auth_internal_SUITE.erl b/test/auth_internal_SUITE.erl index b804a72a18a..0dc8c015274 100644 --- a/test/auth_internal_SUITE.erl +++ b/test/auth_internal_SUITE.erl @@ -1,6 +1,6 @@ -module(auth_internal_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("eunit/include/eunit.hrl"). -include("scram.hrl"). diff --git a/test/auth_jwt_SUITE.erl b/test/auth_jwt_SUITE.erl index 6f833243e94..1283e04a6af 100644 --- a/test/auth_jwt_SUITE.erl +++ b/test/auth_jwt_SUITE.erl @@ -1,5 +1,5 @@ -module(auth_jwt_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). diff --git a/test/auth_tokens_SUITE.erl b/test/auth_tokens_SUITE.erl index 52d8040cd1d..46a5c401405 100644 --- a/test/auth_tokens_SUITE.erl +++ b/test/auth_tokens_SUITE.erl @@ -1,5 +1,5 @@ -module(auth_tokens_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("exml/include/exml.hrl"). -include_lib("common_test/include/ct.hrl"). diff --git a/test/aws_signature_v4_SUITE.erl b/test/aws_signature_v4_SUITE.erl index b0290ff1f97..911befcf5aa 100644 --- a/test/aws_signature_v4_SUITE.erl +++ b/test/aws_signature_v4_SUITE.erl @@ -1,5 +1,5 @@ -module(aws_signature_v4_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/carboncopy_proper_tests_SUITE.erl b/test/carboncopy_proper_tests_SUITE.erl index 7e1950e93d1..93e8cb1bfdf 100644 --- a/test/carboncopy_proper_tests_SUITE.erl +++ b/test/carboncopy_proper_tests_SUITE.erl @@ -6,7 +6,7 @@ %%%------------------------------------------------------------------- -module(carboncopy_proper_tests_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("proper/include/proper.hrl"). diff --git a/test/commands_SUITE.erl b/test/commands_SUITE.erl index 6868d5b1b8f..01350dd62ec 100644 --- a/test/commands_SUITE.erl +++ b/test/commands_SUITE.erl @@ -1,7 +1,7 @@ %% @doc This suite tests both old ejabberd_commands module, which is slowly getting deprecated, %% and the new mongoose_commands implementation. -module(commands_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("exml/include/exml.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/commands_backend_SUITE.erl b/test/commands_backend_SUITE.erl index 013a6109936..779f68ee200 100644 --- a/test/commands_backend_SUITE.erl +++ b/test/commands_backend_SUITE.erl @@ -1,7 +1,7 @@ %% @doc This suite tests both old ejabberd_commands module, which is slowly getting deprecated, %% and the new mongoose_commands implementation. -module(commands_backend_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("exml/include/exml.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/component_reg_SUITE.erl b/test/component_reg_SUITE.erl index a8758817c4d..6593114c628 100644 --- a/test/component_reg_SUITE.erl +++ b/test/component_reg_SUITE.erl @@ -1,5 +1,5 @@ -module(component_reg_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("exml/include/exml.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/config_parser_SUITE.erl b/test/config_parser_SUITE.erl index 77a6458f86a..59f3a496f4f 100644 --- a/test/config_parser_SUITE.erl +++ b/test/config_parser_SUITE.erl @@ -1,5 +1,5 @@ -module(config_parser_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/cowboy_SUITE.erl b/test/cowboy_SUITE.erl index d5f7d5e3ce7..2ca54c7541c 100644 --- a/test/cowboy_SUITE.erl +++ b/test/cowboy_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(cowboy_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). diff --git a/test/ejabberd_admin_SUITE.erl b/test/ejabberd_admin_SUITE.erl index a50b5cd82ba..c99e29a1b4d 100644 --- a/test/ejabberd_admin_SUITE.erl +++ b/test/ejabberd_admin_SUITE.erl @@ -1,5 +1,5 @@ -module(ejabberd_admin_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/ejabberd_c2s_SUITE.erl b/test/ejabberd_c2s_SUITE.erl index e7d7e4aba0d..dae2efd8d15 100644 --- a/test/ejabberd_c2s_SUITE.erl +++ b/test/ejabberd_c2s_SUITE.erl @@ -2,7 +2,7 @@ -include_lib("eunit/include/eunit.hrl"). -include("ejabberd_c2s.hrl"). -include_lib("exml/include/exml_stream.hrl"). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -define(_eq(E, I), ?_assertEqual(E, I)). -define(eq(E, I), ?assertEqual(E, I)). diff --git a/test/ejabberd_config_SUITE.erl b/test/ejabberd_config_SUITE.erl index 076fa641494..6eeeee0219a 100644 --- a/test/ejabberd_config_SUITE.erl +++ b/test/ejabberd_config_SUITE.erl @@ -1,5 +1,5 @@ -module(ejabberd_config_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/ejabberd_hooks_SUITE.erl b/test/ejabberd_hooks_SUITE.erl index 5b366652470..e6b27a8deea 100644 --- a/test/ejabberd_hooks_SUITE.erl +++ b/test/ejabberd_hooks_SUITE.erl @@ -1,5 +1,5 @@ -module(ejabberd_hooks_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -define(HOST, <<"localhost">>). diff --git a/test/ejabberd_listener_SUITE.erl b/test/ejabberd_listener_SUITE.erl index dbfe6c137b4..6d600b81bdb 100644 --- a/test/ejabberd_listener_SUITE.erl +++ b/test/ejabberd_listener_SUITE.erl @@ -1,6 +1,6 @@ -module(ejabberd_listener_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/ejabberd_sm_SUITE.erl b/test/ejabberd_sm_SUITE.erl index 6074dc4c1ba..e7acccff19a 100644 --- a/test/ejabberd_sm_SUITE.erl +++ b/test/ejabberd_sm_SUITE.erl @@ -6,7 +6,7 @@ -include("mongoose.hrl"). -include_lib("jid/include/jid.hrl"). -include_lib("session.hrl"). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -define(_eq(E, I), ?_assertEqual(E, I)). diff --git a/test/gen_hook_SUITE.erl b/test/gen_hook_SUITE.erl index 13123a91b9d..fb7299432f2 100644 --- a/test/gen_hook_SUITE.erl +++ b/test/gen_hook_SUITE.erl @@ -1,5 +1,5 @@ -module(gen_hook_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/gen_mod_SUITE.erl b/test/gen_mod_SUITE.erl index d7022c5e602..c54ff48dbe4 100644 --- a/test/gen_mod_SUITE.erl +++ b/test/gen_mod_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(gen_mod_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -author('bartlomiej.gorny@erlang-solutions.com'). -include_lib("common_test/include/ct.hrl"). diff --git a/test/gen_mod_deps_SUITE.erl b/test/gen_mod_deps_SUITE.erl index 6aeea57926d..1a7c6aec684 100644 --- a/test/gen_mod_deps_SUITE.erl +++ b/test/gen_mod_deps_SUITE.erl @@ -1,5 +1,5 @@ -module(gen_mod_deps_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/http_client_SUITE.erl b/test/http_client_SUITE.erl index dd928e8059c..70473f1d02e 100644 --- a/test/http_client_SUITE.erl +++ b/test/http_client_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(http_client_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/jlib_SUITE.erl b/test/jlib_SUITE.erl index 684a5cc1afc..e687a9e3554 100644 --- a/test/jlib_SUITE.erl +++ b/test/jlib_SUITE.erl @@ -5,7 +5,7 @@ -include("jlib.hrl"). -include("mongoose.hrl"). -include_lib("common_test/include/ct.hrl"). --compile([export_all]). +-compile([export_all, nowarn_export_all]). all() -> [ make_iq_reply_changes_type_to_result, diff --git a/test/keystore_SUITE.erl b/test/keystore_SUITE.erl index 9196084c29e..78e2a8b85cc 100644 --- a/test/keystore_SUITE.erl +++ b/test/keystore_SUITE.erl @@ -1,6 +1,6 @@ -module(keystore_SUITE). -include_lib("eunit/include/eunit.hrl"). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -define(ae(Expected, Actual), ?assertEqual(Expected, Actual)). diff --git a/test/mam_jid_mini_SUITE.erl b/test/mam_jid_mini_SUITE.erl index 81bcbb3fe1f..e0c304d3bed 100644 --- a/test/mam_jid_mini_SUITE.erl +++ b/test/mam_jid_mini_SUITE.erl @@ -1,6 +1,6 @@ -module(mam_jid_mini_SUITE). -include_lib("eunit/include/eunit.hrl"). --compile([export_all]). +-compile([export_all, nowarn_export_all]). all() -> [test_encode_decode_functionality]. diff --git a/test/mod_aws_sns_SUITE.erl b/test/mod_aws_sns_SUITE.erl index 01aaf805d55..c48876cb1d6 100644 --- a/test/mod_aws_sns_SUITE.erl +++ b/test/mod_aws_sns_SUITE.erl @@ -1,6 +1,6 @@ -module(mod_aws_sns_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include("jlib.hrl"). -include("mongoose.hrl"). diff --git a/test/mod_global_distrib_SUITE.erl b/test/mod_global_distrib_SUITE.erl index 42d06f888c5..b42537cad16 100644 --- a/test/mod_global_distrib_SUITE.erl +++ b/test/mod_global_distrib_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(mod_global_distrib_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -author('piotr.nosek@erlang-solutions.com'). -include_lib("common_test/include/ct.hrl"). diff --git a/test/mod_http_upload_s3_SUITE.erl b/test/mod_http_upload_s3_SUITE.erl index b8669c8a7da..ac95edaf61f 100644 --- a/test/mod_http_upload_s3_SUITE.erl +++ b/test/mod_http_upload_s3_SUITE.erl @@ -1,5 +1,5 @@ -module(mod_http_upload_s3_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/mod_mam_meta_SUITE.erl b/test/mod_mam_meta_SUITE.erl index 1499f080fd6..bacccccbf4f 100644 --- a/test/mod_mam_meta_SUITE.erl +++ b/test/mod_mam_meta_SUITE.erl @@ -1,5 +1,5 @@ -module(mod_mam_meta_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/mod_offline_mnesia_SUITE.erl b/test/mod_offline_mnesia_SUITE.erl index d61240bb529..440c50a0b8c 100644 --- a/test/mod_offline_mnesia_SUITE.erl +++ b/test/mod_offline_mnesia_SUITE.erl @@ -2,7 +2,7 @@ -include_lib("eunit/include/eunit.hrl"). -include_lib("common_test/include/ct.hrl"). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -define(OFFLINE_MSG_3_5_FIELDS, [us, timestamp, expire, from, to, packet]). diff --git a/test/mod_websockets_SUITE.erl b/test/mod_websockets_SUITE.erl index fbe00b4bb8f..ac3148f2f57 100644 --- a/test/mod_websockets_SUITE.erl +++ b/test/mod_websockets_SUITE.erl @@ -1,5 +1,5 @@ -module(mod_websockets_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("eunit/include/eunit.hrl"). -define(HANDSHAKE_TIMEOUT, 3000). -define(eq(E, I), ?assertEqual(E, I)). diff --git a/test/mongoose_api_common_SUITE.erl b/test/mongoose_api_common_SUITE.erl index 3e30170ff0e..a66cb723ecd 100644 --- a/test/mongoose_api_common_SUITE.erl +++ b/test/mongoose_api_common_SUITE.erl @@ -1,5 +1,5 @@ -module(mongoose_api_common_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/mongoose_deprecations_SUITE.erl b/test/mongoose_deprecations_SUITE.erl index 3db7898f039..8af6cd72b2d 100644 --- a/test/mongoose_deprecations_SUITE.erl +++ b/test/mongoose_deprecations_SUITE.erl @@ -3,7 +3,7 @@ -include_lib("eunit/include/eunit.hrl"). -include_lib("common_test/include/ct.hrl"). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -define(TEST_COOLDOWN, 50). % ms -define(COOLDOWN_EPS, 3). % ms, must be much smaller than TEST_COOLDOWN diff --git a/test/mongoose_domain_core_SUITE.erl b/test/mongoose_domain_core_SUITE.erl index e52735cc8a8..98647f93a97 100644 --- a/test/mongoose_domain_core_SUITE.erl +++ b/test/mongoose_domain_core_SUITE.erl @@ -1,6 +1,6 @@ -module(mongoose_domain_core_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/mongoose_lazy_routing_SUITE.erl b/test/mongoose_lazy_routing_SUITE.erl index ab852222294..b164c51bb33 100644 --- a/test/mongoose_lazy_routing_SUITE.erl +++ b/test/mongoose_lazy_routing_SUITE.erl @@ -1,6 +1,6 @@ -module(mongoose_lazy_routing_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/mongoose_rabbit_worker_SUITE.erl b/test/mongoose_rabbit_worker_SUITE.erl index 93d784365b0..ca54fdd91fb 100644 --- a/test/mongoose_rabbit_worker_SUITE.erl +++ b/test/mongoose_rabbit_worker_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(mongoose_rabbit_worker_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -author('kacper.mentel@erlang-solutions.com'). -include_lib("common_test/include/ct.hrl"). diff --git a/test/mongoose_rdbms_SUITE.erl b/test/mongoose_rdbms_SUITE.erl index 00ec7cb7272..c17148e1de3 100644 --- a/test/mongoose_rdbms_SUITE.erl +++ b/test/mongoose_rdbms_SUITE.erl @@ -3,7 +3,7 @@ -include_lib("common_test/include/ct.hrl"). -include("mongoose.hrl"). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -define(_eq(E, I), ?_assertEqual(E, I)). -define(eq(E, I), ?assertEqual(E, I)). diff --git a/test/mongoose_service_SUITE.erl b/test/mongoose_service_SUITE.erl index 6dc4307aa0a..b7c7fc9d83c 100644 --- a/test/mongoose_service_SUITE.erl +++ b/test/mongoose_service_SUITE.erl @@ -4,7 +4,7 @@ %%% @end %%%------------------------------------------------------------------- -module(mongoose_service_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/mongoose_subdomain_core_SUITE.erl b/test/mongoose_subdomain_core_SUITE.erl index b8796b457cc..09da33c0e9e 100644 --- a/test/mongoose_subdomain_core_SUITE.erl +++ b/test/mongoose_subdomain_core_SUITE.erl @@ -1,6 +1,6 @@ -module(mongoose_subdomain_core_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/mongoose_wpool_SUITE.erl b/test/mongoose_wpool_SUITE.erl index 42e8d98425e..f7311dc4a5b 100644 --- a/test/mongoose_wpool_SUITE.erl +++ b/test/mongoose_wpool_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(mongoose_wpool_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -author('konrad.zemek@erlang-solutions.com'). -include_lib("common_test/include/ct.hrl"). diff --git a/test/mongooseim_metrics_SUITE.erl b/test/mongooseim_metrics_SUITE.erl index a9679953311..789a716f406 100644 --- a/test/mongooseim_metrics_SUITE.erl +++ b/test/mongooseim_metrics_SUITE.erl @@ -6,7 +6,7 @@ -include("jlib.hrl"). -include_lib("common_test/include/ct.hrl"). --compile([export_all]). +-compile([export_all, nowarn_export_all]). all() -> [ diff --git a/test/monitored_map_SUITE.erl b/test/monitored_map_SUITE.erl index 8c8f554d63a..6afacac5e3e 100644 --- a/test/monitored_map_SUITE.erl +++ b/test/monitored_map_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(monitored_map_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/muc_light_SUITE.erl b/test/muc_light_SUITE.erl index b42493facbc..05b5fb01c82 100644 --- a/test/muc_light_SUITE.erl +++ b/test/muc_light_SUITE.erl @@ -1,5 +1,5 @@ -module(muc_light_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("proper/include/proper.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/privacy_SUITE.erl b/test/privacy_SUITE.erl index 546e3fb8b14..f49dc7916fe 100644 --- a/test/privacy_SUITE.erl +++ b/test/privacy_SUITE.erl @@ -8,7 +8,7 @@ %%%------------------------------------------------------------------- -module(privacy_SUITE). -author("bartek"). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("exml/include/exml.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/pubsub_backend_SUITE.erl b/test/pubsub_backend_SUITE.erl index fcd007221ad..bbf0608e474 100644 --- a/test/pubsub_backend_SUITE.erl +++ b/test/pubsub_backend_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(pubsub_backend_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -author('michael.uvarov@erlang-solutions.com'). -include_lib("common_test/include/ct.hrl"). @@ -188,7 +188,7 @@ people_with_both_parents_unknown() -> <<"Suzi Q Joestar">>, <<"Tomoko Higashikata">>]. -%% Compare lists ignoring order +%% Compare lists ignoring order compare_lists(L1, L2) -> SL1 = lists:sort(L1), SL2 = lists:sort(L2), diff --git a/test/revproxy_SUITE.erl b/test/revproxy_SUITE.erl index 7470af9eb74..b863339b813 100644 --- a/test/revproxy_SUITE.erl +++ b/test/revproxy_SUITE.erl @@ -15,7 +15,7 @@ %%============================================================================== -module(revproxy_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). diff --git a/test/roster_SUITE.erl b/test/roster_SUITE.erl index b3b4fcd3d63..67be3f25134 100644 --- a/test/roster_SUITE.erl +++ b/test/roster_SUITE.erl @@ -14,7 +14,7 @@ -include("mongoose.hrl"). -include_lib("exml/include/exml_stream.hrl"). -include_lib("mod_roster.hrl"). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -define(_eq(E, I), ?_assertEqual(E, I)). -define(eq(E, I), ?assertEqual(E, I)). diff --git a/test/router_SUITE.erl b/test/router_SUITE.erl index b1cbaa344e1..37640873691 100644 --- a/test/router_SUITE.erl +++ b/test/router_SUITE.erl @@ -1,5 +1,5 @@ -module(router_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("exml/include/exml.hrl"). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/safely_SUITE.erl b/test/safely_SUITE.erl index 5ff34f83667..2db6f4e7022 100644 --- a/test/safely_SUITE.erl +++ b/test/safely_SUITE.erl @@ -1,5 +1,5 @@ -module(safely_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("eunit/include/eunit.hrl"). all() -> diff --git a/test/sha_SUITE.erl b/test/sha_SUITE.erl index 83f1fbb3953..d95d4068942 100644 --- a/test/sha_SUITE.erl +++ b/test/sha_SUITE.erl @@ -1,5 +1,5 @@ -module(sha_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("proper/include/proper.hrl"). -import(prop_helper, [prop/2]). diff --git a/test/translate_SUITE.erl b/test/translate_SUITE.erl index 22ec14dd225..9f2320c7073 100644 --- a/test/translate_SUITE.erl +++ b/test/translate_SUITE.erl @@ -1,5 +1,5 @@ -module(translate_SUITE). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include_lib("eunit/include/eunit.hrl"). all() -> diff --git a/test/zlib_driver_SUITE.erl b/test/zlib_driver_SUITE.erl index d596a253c75..4fc7f30bac3 100644 --- a/test/zlib_driver_SUITE.erl +++ b/test/zlib_driver_SUITE.erl @@ -1,6 +1,6 @@ -module(zlib_driver_SUITE). --compile(export_all). +-compile([export_all, nowarn_export_all]). all()-> [stanza_1024]. diff --git a/tools/check-tests-branch.sh b/tools/check-tests-branch.sh deleted file mode 100755 index 7e76349e811..00000000000 --- a/tools/check-tests-branch.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -G_API="https://api.github.com" - -# @TODO CI: -# CI_PULL_REQUEST: ${{ github.event.pull_request.number }} -echo "pull request: ${CI_PULL_REQUEST}" -if [ ${CI_PULL_REQUEST} != "false" ]; then - wget http://stedolan.github.io/jq/download/linux64/jq - chmod +x jq - JQ='./jq -a -M' - PULL_REQ_FILE="/tmp/mongoose_pull_req" - MONGOOSE_REPO_URL="${G_API}/repos/esl/MongooseIM" - curl ${MONGOOSE_REPO_URL}/pulls/${CI_PULL_REQUEST} > ${PULL_REQ_FILE} - M_PULL_USER=`${JQ} '.head.user.login' ${PULL_REQ_FILE}` - M_PULL_USER=${M_PULL_USER//\"/} - M_PULL_BRANCH=`${JQ} '.head.ref' ${PULL_REQ_FILE}` - M_PULL_BRANCH=${M_PULL_BRANCH//\"/} - M_PULL_TEST_REPO_URL=${G_API}/repos/${M_PULL_USER}/ejabberd_tests - M_PULL_USER_EJD_TESTS_BRANCH="${M_PULL_TEST_REPO_URL}/branches/${M_PULL_BRANCH}" - TEST_BRANCH_FILE="/tmp/tests_branch" - curl ${M_PULL_USER_EJD_TESTS_BRANCH} > ${TEST_BRANCH_FILE} - if [ `${JQ} '.name' ${TEST_BRANCH_FILE}` != "null" ]; then - echo "Using tests branch for given pull request" - GIT_REPO="git:\/\/github.com\/${M_PULL_USER}\/ejabberd_tests.git" - NEW_TEST_LINE="{ejabberd_tests, \\\".*\\\", {git, \\\"${GIT_REPO}\\\", {branch, \\\"${M_PULL_BRANCH}\\\"}}}" - sed "s/{ejabberd_tests.*/${NEW_TEST_LINE}/" rebar.tests.config > rebar.tests.config2 - mv rebar.tests.config2 rebar.tests.config - M_COMMENTS_FILE="/tmp/pull_comments" - M_PULL_COMMENTS_URL="${MONGOOSE_REPO_URL}/issues/${CI_PULL_REQUEST}/comments" - curl ${M_PULL_COMMENTS_URL} > ${M_COMMENTS_FILE} - MY_COMMENTS=`${JQ} 'map(select(.user.login == "mongoose-commenter" // .user.login == "mongoose-im")) | length' ${M_COMMENTS_FILE}` - if [ ${MY_COMMENTS} = 0 ]; then - M_PULL_COMMENT="CI is using test branch \`${M_PULL_BRANCH}\` from https://github.com/${M_PULL_USER}/ejabberd_tests/tree/${M_PULL_BRANCH}" - curl -H "Authorization: token ${GITHUB_TOKEN}" \ - -X POST -d "{\"body\":\"${M_PULL_COMMENT}\"" \ - ${M_PULL_COMMENTS_URL} - fi - fi -fi diff --git a/tools/configure b/tools/configure index 0879a7432a8..0637520c501 100755 --- a/tools/configure +++ b/tools/configure @@ -1,6 +1,6 @@ #!/usr/bin/env escript -module(configure). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -mode(compile). -define(b2l(B), binary_to_list(B)). diff --git a/tools/get_sid_benchmark.erl b/tools/get_sid_benchmark.erl index d86d6b9e86a..6b798e52fd0 100644 --- a/tools/get_sid_benchmark.erl +++ b/tools/get_sid_benchmark.erl @@ -1,6 +1,6 @@ -module(get_sid_benchmark). --compile([export_all]). +-compile([export_all, nowarn_export_all]). %% Example results for 1mln of repetitions and data(2): %% diff --git a/tools/privacy.erl b/tools/privacy.erl index 555ad0441c5..53373799163 100644 --- a/tools/privacy.erl +++ b/tools/privacy.erl @@ -1,6 +1,6 @@ -module(privacy). --compile([export_all]). +-compile([export_all, nowarn_export_all]). -include("../include/mod_privacy.hrl"). diff --git a/tools/test_runner/complete-test-name.sh b/tools/test_runner/complete-test-name.sh index 10d8afb0a4b..3c569263c33 100755 --- a/tools/test_runner/complete-test-name.sh +++ b/tools/test_runner/complete-test-name.sh @@ -23,7 +23,7 @@ erlc tools/test_runner/complete_test_name.erl erl -noinput \ -pa tools/test_runner \ -pa _build/test/lib/mongooseim/test/ \ - -pa big_tests/_build/default/lib/ejabberd_tests/ebin/ \ + -pa big_tests/_build/default/lib/mongoose_tests/ebin/ \ -pa big_tests/tests/ \ -s complete_test_name main "${SUITE}" fi diff --git a/tools/test_runner/selected-tests-to-test-spec.sh b/tools/test_runner/selected-tests-to-test-spec.sh index 7897b58fff7..32f21949dd5 100755 --- a/tools/test_runner/selected-tests-to-test-spec.sh +++ b/tools/test_runner/selected-tests-to-test-spec.sh @@ -24,7 +24,7 @@ erl -noinput \ -pa tools/test_runner \ -pa _build/test/lib/mongooseim/test/ \ -pa big_tests/tests/ \ - -pa big_tests/_build/default/lib/ejabberd_tests/ebin/ \ + -pa big_tests/_build/default/lib/mongoose_tests/ebin/ \ -s selected_tests_to_test_spec main $@ fi