test(emqx_rule_engine_SUITE): delegate app start to ct-helper (2.0.0)

This commit is contained in:
Zaiming Shi 2021-06-05 22:34:10 +02:00
parent b92a6837d7
commit 4ee6c82714
2 changed files with 6 additions and 11 deletions

View File

@ -2553,25 +2553,20 @@ stop_apps() ->
start_apps() ->
[start_apps(App, SchemaFile, ConfigFile) ||
{App, SchemaFile, ConfigFile}
<- [{emqx, deps_path(emqx, "priv/emqx.schema"),
deps_path(emqx, "etc/emqx.conf.rendered")},
<- [{emqx, emqx_schema, deps_path(emqx, "etc/emqx.conf")},
{emqx_rule_engine, local_path("priv/emqx_rule_engine.schema"),
local_path("etc/emqx_rule_engine.conf")}]].
start_apps(App, SchemaFile, ConfigFile) ->
emqx_ct_helpers:read_schema_configs(SchemaFile, ConfigFile),
set_special_configs(App),
{ok, _} = application:ensure_all_started(App).
start_apps(App, Schema, ConfigFile) ->
emqx_ct_helpers:start_app(App, Schema, ConfigFile, fun set_special_configs/1).
deps_path(App, RelativePath) ->
%% Note: not lib_dir because etc dir is not sym-link-ed to _build dir
%% but priv dir is
Path0 = code:priv_dir(App),
Path0 = code:lib_dir(App),
Path = case file:read_link(Path0) of
{ok, Resolved} -> Resolved;
{error, _} -> Path0
end,
filename:join([Path, "..", RelativePath]).
filename:join([Path, RelativePath]).
local_path(RelativePath) ->
deps_path(emqx_rule_engine, RelativePath).

View File

@ -106,7 +106,7 @@ test_plugins() ->
test_deps() ->
[ {bbmustache, "1.10.0"}
, {emqx_ct_helpers, {git, "https://github.com/emqx/emqx-ct-helpers", {branch, "hocon"}}}
, {emqx_ct_helpers, {git, "https://github.com/emqx/emqx-ct-helpers", {tag, "2.0.0"}}}
, meck
].