refactor: delete emqx_resource:remove api
this api is only used in tests, changed to call the _local flavor instead
This commit is contained in:
parent
8541d2efc1
commit
06e0a7f2ed
|
@ -47,7 +47,6 @@
|
||||||
recreate_local/3,
|
recreate_local/3,
|
||||||
recreate_local/4,
|
recreate_local/4,
|
||||||
%% remove the config and stop the instance
|
%% remove the config and stop the instance
|
||||||
remove/1,
|
|
||||||
remove_local/1,
|
remove_local/1,
|
||||||
reset_metrics/1,
|
reset_metrics/1,
|
||||||
reset_metrics_local/1,
|
reset_metrics_local/1,
|
||||||
|
@ -307,10 +306,6 @@ recreate_local(ResId, ResourceType, Config) ->
|
||||||
recreate_local(ResId, ResourceType, Config, Opts) ->
|
recreate_local(ResId, ResourceType, Config, Opts) ->
|
||||||
emqx_resource_manager:recreate(ResId, ResourceType, Config, Opts).
|
emqx_resource_manager:recreate(ResId, ResourceType, Config, Opts).
|
||||||
|
|
||||||
-spec remove(resource_id()) -> ok | {error, Reason :: term()}.
|
|
||||||
remove(ResId) ->
|
|
||||||
emqx_resource_proto_v1:remove(ResId).
|
|
||||||
|
|
||||||
-spec remove_local(resource_id()) -> ok.
|
-spec remove_local(resource_id()) -> ok.
|
||||||
remove_local(ResId) ->
|
remove_local(ResId) ->
|
||||||
case emqx_resource_manager:remove(ResId) of
|
case emqx_resource_manager:remove(ResId) of
|
||||||
|
|
|
@ -46,7 +46,7 @@ init_per_testcase(_, Config) ->
|
||||||
|
|
||||||
end_per_testcase(_, _Config) ->
|
end_per_testcase(_, _Config) ->
|
||||||
snabbkaffe:stop(),
|
snabbkaffe:stop(),
|
||||||
_ = emqx_resource:remove(?ID),
|
_ = emqx_resource:remove_local(?ID),
|
||||||
emqx_common_test_helpers:call_janitor(),
|
emqx_common_test_helpers:call_janitor(),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
|
@ -110,8 +110,8 @@ t_create_remove(_) ->
|
||||||
|
|
||||||
?assert(is_process_alive(Pid)),
|
?assert(is_process_alive(Pid)),
|
||||||
|
|
||||||
?assertEqual(ok, emqx_resource:remove(?ID)),
|
?assertEqual(ok, emqx_resource:remove_local(?ID)),
|
||||||
?assertMatch(ok, emqx_resource:remove(?ID)),
|
?assertMatch(ok, emqx_resource:remove_local(?ID)),
|
||||||
|
|
||||||
?assertNot(is_process_alive(Pid))
|
?assertNot(is_process_alive(Pid))
|
||||||
end,
|
end,
|
||||||
|
@ -1218,7 +1218,7 @@ t_reset_metrics(_) ->
|
||||||
{ok, #{pid := Pid}} = emqx_resource:query(?ID, get_state),
|
{ok, #{pid := Pid}} = emqx_resource:query(?ID, get_state),
|
||||||
emqx_resource:reset_metrics(?ID),
|
emqx_resource:reset_metrics(?ID),
|
||||||
?assert(is_process_alive(Pid)),
|
?assert(is_process_alive(Pid)),
|
||||||
ok = emqx_resource:remove(?ID),
|
ok = emqx_resource:remove_local(?ID),
|
||||||
?assertNot(is_process_alive(Pid)).
|
?assertNot(is_process_alive(Pid)).
|
||||||
|
|
||||||
t_auto_retry(_) ->
|
t_auto_retry(_) ->
|
||||||
|
|
Loading…
Reference in New Issue