Start emqx-modules application by default (#4518)

* fix(modules): start emqx_modules by default

* chore(test): eliminate some compile warnings
This commit is contained in:
JianBo He 2021-04-12 09:45:31 +08:00 committed by GitHub
parent b5edba7729
commit 16c999ed9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 22 deletions

View File

@ -17,6 +17,7 @@
-module(emqx_auth_pgsql_SUITE).
-compile(export_all).
-compile(nowarn_export_all).
-define(POOL, emqx_auth_pgsql).

View File

@ -17,6 +17,7 @@
-module(emqx_auth_redis_SUITE).
-compile(export_all).
-compile(nowarn_export_all).
-include_lib("emqx/include/emqx.hrl").

View File

@ -325,9 +325,6 @@ peer2addr({Host, _}) ->
peer2addr(Host) ->
list_to_binary(inet:ntoa(Host)).
ensure_to_binary(Atom) when is_atom(Atom) -> atom_to_binary(Atom, utf8);
ensure_to_binary(Bin) when is_binary(Bin) -> Bin.
stringfy({shutdown, Reason}) ->
stringfy(Reason);
stringfy(Term) when is_atom(Term); is_binary(Term) ->
@ -343,17 +340,6 @@ receive_http_request_body() ->
exit(waiting_message_timeout)
end.
receive_http_request_bodys() ->
receive_http_request_bodys_([]).
receive_http_request_bodys_(Acc) ->
receive
{post, _, _, Body} ->
receive_http_request_bodys_([Body|Acc])
after 1000 ->
lists:reverse(Acc)
end.
filter_topictab(TopicTab, {undefined}) ->
TopicTab;
filter_topictab(TopicTab, {TopicFilter}) ->
@ -399,9 +385,6 @@ topic_filter_env() ->
payload_encode() ->
oneof([base62, base64, undefined]).
http_code() ->
oneof([socket_closed_remotely, others]).
disconnected_conninfo() ->
?LET(Info, conninfo(),
begin

View File

@ -3,7 +3,7 @@
{vsn, "4.3.0"}, % strict semver, bump manually!
{modules, []},
{registered, [emqx_telemetry_sup]},
{applications, [kernel,stdlib,emqx_modules]},
{applications, [kernel,stdlib]},
{mod, {emqx_telemetry_app,[]}},
{env, []},
{licenses, ["Apache-2.0"]},

View File

@ -234,10 +234,20 @@ shutdown(Reason) ->
?LOG(critical, "emqx shutdown for ~s", [Reason]),
_ = emqx_alarm_handler:unload(),
_ = emqx_plugins:unload(),
lists:foreach(fun application:stop/1, [emqx, ekka, cowboy, ranch, esockd, gproc]).
lists:foreach(fun application:stop/1
, lists:reverse(default_started_applications())
).
reboot() ->
lists:foreach(fun application:start/1, [gproc, esockd, ranch, cowboy, ekka, emqx]).
lists:foreach(fun application:start/1 , default_started_applications()).
-ifdef(EMQX_ENTERPRISE).
default_started_applications() ->
[gproc, esockd, ranch, cowboy, ekka, emqx].
-else.
default_started_applications() ->
[gproc, esockd, ranch, cowboy, ekka, emqx, emqx_modules].
-endif.
%%--------------------------------------------------------------------
%% Internal functions

View File

@ -86,8 +86,7 @@ init_per_testcase(TestCase, Config) when
init_per_testcase(_, Config) ->
Config.
end_per_testcase(TestCase, Config) when
end_per_testcase(TestCase, _Config) when
TestCase =/= t_ws_sub_protocols_mqtt_equivalents,
TestCase =/= t_ws_sub_protocols_mqtt,
TestCase =/= t_ws_check_origin,