test: start emqx_opentelemetry in emqx_machine SUITE
This commit is contained in:
parent
c215fe3736
commit
8ab6eb5638
|
@ -42,7 +42,7 @@ init_per_suite(Config) ->
|
||||||
%% Unload emqx_authz to avoid reboot this application
|
%% Unload emqx_authz to avoid reboot this application
|
||||||
%%
|
%%
|
||||||
application:unload(emqx_authz),
|
application:unload(emqx_authz),
|
||||||
emqx_common_test_helpers:start_apps([emqx_conf]),
|
emqx_common_test_helpers:start_apps([emqx_conf, emqx_opentelemetry]),
|
||||||
application:set_env(emqx_machine, applications, [
|
application:set_env(emqx_machine, applications, [
|
||||||
emqx_prometheus,
|
emqx_prometheus,
|
||||||
emqx_modules,
|
emqx_modules,
|
||||||
|
@ -56,12 +56,13 @@ init_per_suite(Config) ->
|
||||||
emqx_exhook,
|
emqx_exhook,
|
||||||
emqx_authn,
|
emqx_authn,
|
||||||
emqx_authz,
|
emqx_authz,
|
||||||
emqx_plugin
|
emqx_plugin,
|
||||||
|
emqx_opentelemetry
|
||||||
]),
|
]),
|
||||||
Config.
|
Config.
|
||||||
|
|
||||||
end_per_suite(_Config) ->
|
end_per_suite(_Config) ->
|
||||||
emqx_common_test_helpers:stop_apps([]).
|
emqx_common_test_helpers:stop_apps([emqx_opentelemetry, emqx_conf]).
|
||||||
|
|
||||||
init_per_testcase(t_custom_shard_transports, Config) ->
|
init_per_testcase(t_custom_shard_transports, Config) ->
|
||||||
OldConfig = application:get_env(emqx_machine, custom_shard_transports),
|
OldConfig = application:get_env(emqx_machine, custom_shard_transports),
|
||||||
|
|
|
@ -30,10 +30,15 @@ start_otel(Conf) ->
|
||||||
|
|
||||||
stop_otel() ->
|
stop_otel() ->
|
||||||
ok = cleanup(),
|
ok = cleanup(),
|
||||||
case supervisor:terminate_child(?SUPERVISOR, ?MODULE) of
|
case erlang:whereis(?SUPERVISOR) of
|
||||||
ok -> supervisor:delete_child(?SUPERVISOR, ?MODULE);
|
undefined ->
|
||||||
{error, not_found} -> ok;
|
ok;
|
||||||
Error -> Error
|
Pid ->
|
||||||
|
case supervisor:terminate_child(Pid, ?MODULE) of
|
||||||
|
ok -> supervisor:delete_child(Pid, ?MODULE);
|
||||||
|
{error, not_found} -> ok;
|
||||||
|
Error -> Error
|
||||||
|
end
|
||||||
end.
|
end.
|
||||||
|
|
||||||
start_link(Conf) ->
|
start_link(Conf) ->
|
||||||
|
|
Loading…
Reference in New Issue