test: recover boot_modules app env after test

This commit is contained in:
Zaiming (Stone) Shi 2023-01-16 12:48:17 +01:00
parent 86b4d4d23b
commit 33be7672ad
2 changed files with 21 additions and 16 deletions

View File

@ -128,6 +128,7 @@ all() ->
init_per_suite(Config) ->
application:set_env(ekka, strict_mode, true),
emqx_common_test_helpers:boot_modules(all),
emqx_common_test_helpers:start_apps([]),
Config.

View File

@ -24,6 +24,7 @@
all() -> emqx_common_test_helpers:all(?MODULE).
t_is_enabled(_) ->
try
ok = application:set_env(emqx, boot_modules, all),
?assert(emqx_boot:is_enabled(router)),
?assert(emqx_boot:is_enabled(broker)),
@ -39,4 +40,7 @@ t_is_enabled(_) ->
ok = application:set_env(emqx, boot_modules, [router, broker, listeners]),
?assert(emqx_boot:is_enabled(router)),
?assert(emqx_boot:is_enabled(broker)),
?assert(emqx_boot:is_enabled(listeners)).
?assert(emqx_boot:is_enabled(listeners))
after
application:set_env(emqx, boot_modules, all)
end.