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"},
|
||||
{description, "The EMQX Machine"},
|
||||
% strict semver, bump manually!
|
||||
{vsn, "0.2.2"},
|
||||
{vsn, "0.2.3"},
|
||||
{modules, []},
|
||||
{registered, []},
|
||||
{applications, [kernel, stdlib, emqx_ctl]},
|
||||
|
|
|
@ -43,7 +43,7 @@ start() ->
|
|||
start_sysmon(),
|
||||
configure_shard_transports(),
|
||||
ekka:start(),
|
||||
ok = print_otp_version_warning().
|
||||
ok.
|
||||
|
||||
graceful_shutdown() ->
|
||||
emqx_machine_terminator:graceful_wait().
|
||||
|
@ -61,17 +61,6 @@ set_backtrace_depth() ->
|
|||
is_ready() ->
|
||||
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() ->
|
||||
_ = application:load(system_monitor),
|
||||
application:set_env(system_monitor, node_status_fun, {?MODULE, node_status}),
|
||||
|
|
|
@ -103,3 +103,13 @@ t_custom_shard_transports(_Config) ->
|
|||
emqx_machine:start(),
|
||||
?assertEqual(distr, mria_config:shard_transport(Shard)),
|
||||
ok.
|
||||
|
||||
t_node_status(_Config) ->
|
||||
JSON = emqx_machine:node_status(),
|
||||
?assertMatch(
|
||||
#{
|
||||
<<"backend">> := _,
|
||||
<<"role">> := <<"core">>
|
||||
},
|
||||
jsx:decode(JSON)
|
||||
).
|
||||
|
|
Loading…
Reference in New Issue