Merge pull request #10536 from zmstone/0118-for-better-test-coverage
0118 for better test coverage
This commit is contained in:
commit
cad4144773
|
@ -3,7 +3,7 @@
|
||||||
{id, "emqx_machine"},
|
{id, "emqx_machine"},
|
||||||
{description, "The EMQX Machine"},
|
{description, "The EMQX Machine"},
|
||||||
% strict semver, bump manually!
|
% strict semver, bump manually!
|
||||||
{vsn, "0.2.2"},
|
{vsn, "0.2.3"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications, [kernel, stdlib, emqx_ctl]},
|
{applications, [kernel, stdlib, emqx_ctl]},
|
||||||
|
|
|
@ -43,7 +43,7 @@ start() ->
|
||||||
start_sysmon(),
|
start_sysmon(),
|
||||||
configure_shard_transports(),
|
configure_shard_transports(),
|
||||||
ekka:start(),
|
ekka:start(),
|
||||||
ok = print_otp_version_warning().
|
ok.
|
||||||
|
|
||||||
graceful_shutdown() ->
|
graceful_shutdown() ->
|
||||||
emqx_machine_terminator:graceful_wait().
|
emqx_machine_terminator:graceful_wait().
|
||||||
|
@ -61,17 +61,6 @@ set_backtrace_depth() ->
|
||||||
is_ready() ->
|
is_ready() ->
|
||||||
emqx_machine_terminator:is_running().
|
emqx_machine_terminator:is_running().
|
||||||
|
|
||||||
-if(?OTP_RELEASE > 22).
|
|
||||||
print_otp_version_warning() -> ok.
|
|
||||||
-else.
|
|
||||||
print_otp_version_warning() ->
|
|
||||||
?ULOG(
|
|
||||||
"WARNING: Running on Erlang/OTP version ~p. Recommended: 23~n",
|
|
||||||
[?OTP_RELEASE]
|
|
||||||
).
|
|
||||||
% OTP_RELEASE > 22
|
|
||||||
-endif.
|
|
||||||
|
|
||||||
start_sysmon() ->
|
start_sysmon() ->
|
||||||
_ = application:load(system_monitor),
|
_ = application:load(system_monitor),
|
||||||
application:set_env(system_monitor, node_status_fun, {?MODULE, node_status}),
|
application:set_env(system_monitor, node_status_fun, {?MODULE, node_status}),
|
||||||
|
|
|
@ -103,3 +103,13 @@ t_custom_shard_transports(_Config) ->
|
||||||
emqx_machine:start(),
|
emqx_machine:start(),
|
||||||
?assertEqual(distr, mria_config:shard_transport(Shard)),
|
?assertEqual(distr, mria_config:shard_transport(Shard)),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
|
t_node_status(_Config) ->
|
||||||
|
JSON = emqx_machine:node_status(),
|
||||||
|
?assertMatch(
|
||||||
|
#{
|
||||||
|
<<"backend">> := _,
|
||||||
|
<<"role">> := <<"core">>
|
||||||
|
},
|
||||||
|
jsx:decode(JSON)
|
||||||
|
).
|
||||||
|
|
Loading…
Reference in New Issue