Sfoglia il codice sorgente

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

Zaiming Shi 4 anni fa
parent
commit
4ee6c82714
2 ha cambiato i file con 6 aggiunte e 11 eliminazioni
  1. 5 10
      apps/emqx_rule_engine/test/emqx_rule_engine_SUITE.erl
  2. 1 1
      rebar.config.erl

+ 5 - 10
apps/emqx_rule_engine/test/emqx_rule_engine_SUITE.erl

@@ -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).

+ 1 - 1
rebar.config.erl

@@ -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
     ].