Просмотр исходного кода

test: move dashboard specific cleanup call from emqx_common_test_helpers to the relevant test suite

Serge Tupchii 2 лет назад
Родитель
Сommit
e3541d8947

+ 0 - 1
apps/emqx/test/emqx_common_test_helpers.erl

@@ -202,7 +202,6 @@ start_apps(Apps, SpecAppConfig, Opts) when is_function(SpecAppConfig) ->
     %% Because, minirest, ekka etc.. application will scan these modules
     lists:foreach(fun load/1, [emqx | Apps]),
     ok = start_ekka(),
-    mnesia:clear_table(emqx_admin),
     ok = emqx_ratelimiter_SUITE:load_conf(),
     lists:foreach(fun(App) -> start_app(App, SpecAppConfig, Opts) end, [emqx | Apps]).
 

+ 1 - 8
apps/emqx_dashboard/test/emqx_dashboard_SUITE.erl

@@ -56,14 +56,6 @@
 all() ->
     emqx_common_test_helpers:all(?MODULE).
 
-end_suite() ->
-    end_suite([]).
-
-end_suite(Apps) ->
-    application:unload(emqx_management),
-    mnesia:clear_table(?ADMIN),
-    emqx_common_test_helpers:stop_apps(Apps ++ [emqx_dashboard]).
-
 init_per_suite(Config) ->
     emqx_common_test_helpers:start_apps(
         [emqx_management, emqx_dashboard],
@@ -72,6 +64,7 @@ init_per_suite(Config) ->
     Config.
 
 end_per_suite(_Config) ->
+    mnesia:clear_table(?ADMIN),
     emqx_common_test_helpers:stop_apps([emqx_dashboard, emqx_management]),
     mria:stop().
 

+ 2 - 0
apps/emqx_dashboard/test/emqx_dashboard_monitor_SUITE.erl

@@ -33,10 +33,12 @@ all() ->
 init_per_suite(Config) ->
     application:load(emqx_dashboard),
     mria:start(),
+    mnesia:clear_table(?ADMIN),
     emqx_common_test_helpers:start_apps([emqx_dashboard], fun set_special_configs/1),
     Config.
 
 end_per_suite(Config) ->
+    mnesia:clear_table(?ADMIN),
     emqx_common_test_helpers:stop_apps([emqx_dashboard]),
     Config.