Forráskód Böngészése

test: fix inter test suite problem

Kjell Winblad 1 éve
szülő
commit
958748cf7f

+ 8 - 0
apps/emqx_rule_engine/rebar.config

@@ -5,6 +5,14 @@
     {emqx_utils, {path, "../emqx_utils"}}
 ]}.
 
+{profiles, [
+    {test, [
+        {deps, [
+            {emqx_bridge_http, {path, "../emqx_bridge_http"}}
+        ]}
+    ]}
+]}.
+
 {erl_opts, [
     warn_unused_vars,
     warn_shadow_vars,

+ 13 - 8
apps/emqx_rule_engine/test/emqx_rule_engine_api_rule_apply_SUITE.erl

@@ -30,15 +30,20 @@ all() ->
 
 init_per_suite(Config) ->
     application:load(emqx_conf),
+    AppsToStart = [
+        emqx,
+        emqx_conf,
+        emqx_connector,
+        emqx_bridge,
+        emqx_bridge_http,
+        emqx_rule_engine
+    ],
+    %% I don't know why we need to stop the apps and then start them but if we
+    %% don't do this and other suites run before this suite the test cases will
+    %% fail as it seems like the connector silently refuses to start.
+    ok = emqx_cth_suite:stop(AppsToStart),
     Apps = emqx_cth_suite:start(
-        [
-            emqx,
-            emqx_conf,
-            emqx_connector,
-            emqx_bridge_http,
-            emqx_bridge,
-            emqx_rule_engine
-        ],
+        AppsToStart,
         #{work_dir => emqx_cth_suite:work_dir(Config)}
     ),
     emqx_mgmt_api_test_util:init_suite(),