fix(dashboard): meck `emqx_retainer` in SUITE
This commit is contained in:
parent
3d6b65aced
commit
7bc3a5090d
|
@ -145,8 +145,6 @@ dashboard_samplers_fun(Latest) ->
|
||||||
end
|
end
|
||||||
end.
|
end.
|
||||||
|
|
||||||
monitor_current(get, #{bindings := []}) ->
|
|
||||||
emqx_utils_api:with_node_or_cluster(erlang:node(), fun emqx_dashboard_monitor:current_rate/1);
|
|
||||||
monitor_current(get, #{bindings := Bindings}) ->
|
monitor_current(get, #{bindings := Bindings}) ->
|
||||||
RawNode = maps:get(node, Bindings, <<"all">>),
|
RawNode = maps:get(node, Bindings, <<"all">>),
|
||||||
emqx_utils_api:with_node_or_cluster(RawNode, fun current_rate/1).
|
emqx_utils_api:with_node_or_cluster(RawNode, fun current_rate/1).
|
||||||
|
|
|
@ -31,10 +31,13 @@ all() ->
|
||||||
emqx_common_test_helpers:all(?MODULE).
|
emqx_common_test_helpers:all(?MODULE).
|
||||||
|
|
||||||
init_per_suite(Config) ->
|
init_per_suite(Config) ->
|
||||||
|
meck:new(emqx_retainer, [non_strict, passthrough, no_history, no_link]),
|
||||||
|
meck:expect(emqx_retainer, retained_count, fun() -> 0 end),
|
||||||
emqx_mgmt_api_test_util:init_suite([]),
|
emqx_mgmt_api_test_util:init_suite([]),
|
||||||
Config.
|
Config.
|
||||||
|
|
||||||
end_per_suite(_Config) ->
|
end_per_suite(_Config) ->
|
||||||
|
meck:unload([emqx_retainer]),
|
||||||
emqx_mgmt_api_test_util:end_suite([]).
|
emqx_mgmt_api_test_util:end_suite([]).
|
||||||
|
|
||||||
t_monitor_samplers_all(_Config) ->
|
t_monitor_samplers_all(_Config) ->
|
||||||
|
@ -198,5 +201,5 @@ waiting_emqx_stats_and_monitor_update(WaitKey) ->
|
||||||
end,
|
end,
|
||||||
meck:unload([emqx_stats]),
|
meck:unload([emqx_stats]),
|
||||||
%% manually call monitor update
|
%% manually call monitor update
|
||||||
_ = emqx_dashboard_monitor:current_rate(),
|
_ = emqx_dashboard_monitor:current_rate_cluster(),
|
||||||
ok.
|
ok.
|
||||||
|
|
Loading…
Reference in New Issue