diff --git a/apps/emqx_machine/src/emqx_machine_boot.erl b/apps/emqx_machine/src/emqx_machine_boot.erl index 24541990b..2084d3a05 100644 --- a/apps/emqx_machine/src/emqx_machine_boot.erl +++ b/apps/emqx_machine/src/emqx_machine_boot.erl @@ -135,6 +135,12 @@ add_app(G, App, undefined) -> ?SLOG(debug, #{msg => "app_is_not_loaded", app => App}), %% not loaded add_app(G, App, []); +% We ALWAYS want to add `emqx_conf', even if no other app declare a +% dependency on it. Otherwise, emqx may fail to load the config +% schemas, especially in the test profile. +add_app(G, App = emqx_conf, []) -> + digraph:add_vertex(G, App), + ok; add_app(_G, _App, []) -> ok; add_app(G, App, [Dep | Deps]) -> diff --git a/apps/emqx_machine/test/emqx_machine_SUITE.erl b/apps/emqx_machine/test/emqx_machine_SUITE.erl index 03d9e6ba9..a760d2f5f 100644 --- a/apps/emqx_machine/test/emqx_machine_SUITE.erl +++ b/apps/emqx_machine/test/emqx_machine_SUITE.erl @@ -43,7 +43,7 @@ init_per_suite(Config) -> %% application:unload(emqx_authz), - emqx_common_test_helpers:start_apps([]), + emqx_common_test_helpers:start_apps([emqx_conf]), Config. end_per_suite(_Config) -> diff --git a/apps/emqx_resource/src/emqx_resource.app.src b/apps/emqx_resource/src/emqx_resource.app.src index 8e5d12fea..9591c5718 100644 --- a/apps/emqx_resource/src/emqx_resource.app.src +++ b/apps/emqx_resource/src/emqx_resource.app.src @@ -9,8 +9,7 @@ stdlib, gproc, jsx, - emqx, - emqx_conf + emqx ]}, {env,[]}, {modules, []},