diff --git a/apps/emqx_dashboard/test/emqx_dashboard_SUITE.erl b/apps/emqx_dashboard/test/emqx_dashboard_SUITE.erl index 783c00dad..0d446a7f2 100644 --- a/apps/emqx_dashboard/test/emqx_dashboard_SUITE.erl +++ b/apps/emqx_dashboard/test/emqx_dashboard_SUITE.erl @@ -55,6 +55,10 @@ all() -> emqx_common_test_helpers:all(?MODULE). init_per_suite(Config) -> + %% Load all applications to ensure swagger.json is fully generated. + Apps = emqx_machine_boot:reboot_apps(), + ct:pal("load apps:~p~n", [Apps]), + lists:foreach(fun(App) -> application:load(App) end, Apps), emqx_mgmt_api_test_util:init_suite([emqx_management]), Config. diff --git a/apps/emqx_machine/src/emqx_machine_boot.erl b/apps/emqx_machine/src/emqx_machine_boot.erl index f74db45ec..266855877 100644 --- a/apps/emqx_machine/src/emqx_machine_boot.erl +++ b/apps/emqx_machine/src/emqx_machine_boot.erl @@ -26,7 +26,7 @@ -dialyzer({no_match, [basic_reboot_apps/0]}). -ifdef(TEST). --export([sorted_reboot_apps/1]). +-export([sorted_reboot_apps/1, reboot_apps/0]). -endif. %% these apps are always (re)started by emqx_machine @@ -120,7 +120,7 @@ restart_type(App) -> %% the list of (re)started apps depends on release type/edition reboot_apps() -> - {ok, ConfigApps0} = application:get_env(emqx_machine, applications), + ConfigApps0 = application:get_env(emqx_machine, applications, []), BaseRebootApps = basic_reboot_apps(), ConfigApps = lists:filter(fun(App) -> not lists:member(App, BaseRebootApps) end, ConfigApps0), BaseRebootApps ++ ConfigApps.