test: allow missing schema for app in tests
This commit is contained in:
parent
256cdd50ff
commit
050f68cf5d
|
@ -181,11 +181,15 @@ start_app(App, Handler) ->
|
||||||
app_conf_file(emqx_conf) -> "emqx.conf.all";
|
app_conf_file(emqx_conf) -> "emqx.conf.all";
|
||||||
app_conf_file(App) -> atom_to_list(App) ++ ".conf".
|
app_conf_file(App) -> atom_to_list(App) ++ ".conf".
|
||||||
|
|
||||||
%% TODO: get rid of cuttlefish
|
|
||||||
app_schema(App) ->
|
app_schema(App) ->
|
||||||
Mod = list_to_atom(atom_to_list(App) ++ "_schema"),
|
Mod = list_to_atom(atom_to_list(App) ++ "_schema"),
|
||||||
|
try
|
||||||
true = is_list(Mod:roots()),
|
true = is_list(Mod:roots()),
|
||||||
Mod.
|
Mod
|
||||||
|
catch
|
||||||
|
error:undef ->
|
||||||
|
no_schema
|
||||||
|
end.
|
||||||
|
|
||||||
mustache_vars(App) ->
|
mustache_vars(App) ->
|
||||||
[
|
[
|
||||||
|
@ -221,6 +225,8 @@ render_config_file(ConfigFile, Vars0) ->
|
||||||
ok = file:write_file(NewName, Targ),
|
ok = file:write_file(NewName, Targ),
|
||||||
NewName.
|
NewName.
|
||||||
|
|
||||||
|
read_schema_configs(no_schema, _ConfigFile) ->
|
||||||
|
ok;
|
||||||
read_schema_configs(Schema, ConfigFile) ->
|
read_schema_configs(Schema, ConfigFile) ->
|
||||||
NewConfig = generate_config(Schema, ConfigFile),
|
NewConfig = generate_config(Schema, ConfigFile),
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
|
|
Loading…
Reference in New Issue