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

fix(emqx_rule_engine_SUITE): use emqx_ct_helpers:read_schema_configs

z8674558 4 лет назад
Родитель
Сommit
a9efdaeacd
1 измененных файлов с 1 добавлено и 9 удалено
  1. 1 9
      apps/emqx_rule_engine/test/emqx_rule_engine_SUITE.erl

+ 1 - 9
apps/emqx_rule_engine/test/emqx_rule_engine_SUITE.erl

@@ -2559,18 +2559,10 @@ start_apps() ->
                                    local_path("etc/emqx_rule_engine.conf")}]].
 
 start_apps(App, SchemaFile, ConfigFile) ->
-    read_schema_configs(App, SchemaFile, ConfigFile),
+    emqx_ct_helpers:read_schema_configs(SchemaFile, ConfigFile),
     set_special_configs(App),
     {ok, _} = application:ensure_all_started(App).
 
-read_schema_configs(App, SchemaFile, ConfigFile) ->
-    ct:pal("Read configs - SchemaFile: ~p, ConfigFile: ~p", [SchemaFile, ConfigFile]),
-    Schema = cuttlefish_schema:files([SchemaFile]),
-    {ok, Conf} = hocon:load(ConfigFile, #{format => proplists}),
-    NewConfig = cuttlefish_generator:map(Schema, Conf),
-    Vals = proplists:get_value(App, NewConfig, []),
-    [application:set_env(App, Par, Value) || {Par, Value} <- Vals].
-
 deps_path(App, RelativePath) ->
     %% Note: not lib_dir because etc dir is not sym-link-ed to _build dir
     %% but priv dir is