From 0cf5aa561156dc35c89728c54a7359780f5e5347 Mon Sep 17 00:00:00 2001 From: Zaiming Shi Date: Tue, 19 Oct 2021 17:13:19 +0200 Subject: [PATCH] test: remove cuttlefish code --- apps/emqx/test/emqx_common_test_helpers.erl | 29 +++------------------ 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/apps/emqx/test/emqx_common_test_helpers.erl b/apps/emqx/test/emqx_common_test_helpers.erl index 119f39ae2..20ce756a0 100644 --- a/apps/emqx/test/emqx_common_test_helpers.erl +++ b/apps/emqx/test/emqx_common_test_helpers.erl @@ -148,27 +148,10 @@ start_app(App, Handler) -> app_path(App, filename:join(["etc", atom_to_list(App) ++ ".conf"])), Handler). -%% TODO: get rid of cuttlefish app_schema(App) -> - CuttlefishSchema = app_path(App, filename:join(["priv", atom_to_list(App) ++ ".schema"])), - case filelib:is_regular(CuttlefishSchema) of - true -> - CuttlefishSchema; - false -> - Mod = list_to_atom(atom_to_list(App) ++ "_schema"), - try - true = is_list(Mod:roots()), - Mod - catch - C : E -> - error(#{app => App, - file => CuttlefishSchema, - module => Mod, - exeption => C, - reason => E - }) - end - end. + Mod = list_to_atom(atom_to_list(App) ++ "_schema"), + true = is_list(Mod:roots()), + Mod. mustache_vars(App) -> [{platform_data_dir, app_path(App, "data")}, @@ -208,11 +191,7 @@ read_schema_configs(Schema, ConfigFile) -> generate_config(SchemaModule, ConfigFile) when is_atom(SchemaModule) -> {ok, Conf0} = hocon:load(ConfigFile, #{format => richmap}), - hocon_schema:generate(SchemaModule, Conf0); -generate_config(SchemaFile, ConfigFile) -> - {ok, Conf1} = hocon:load(ConfigFile, #{format => proplists}), - Schema = cuttlefish_schema:files([SchemaFile]), - cuttlefish_generator:map(Schema, Conf1). + hocon_schema:generate(SchemaModule, Conf0). -spec(stop_apps(list()) -> ok). stop_apps(Apps) ->