From 958748cf7ff2117cb049aa168d6de4ff47c05d79 Mon Sep 17 00:00:00 2001 From: Kjell Winblad Date: Tue, 9 Apr 2024 11:10:39 +0200 Subject: [PATCH] test: fix inter test suite problem --- apps/emqx_rule_engine/rebar.config | 8 +++++++ .../emqx_rule_engine_api_rule_apply_SUITE.erl | 21 ++++++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/apps/emqx_rule_engine/rebar.config b/apps/emqx_rule_engine/rebar.config index 07c53d3e3..d51bffa20 100644 --- a/apps/emqx_rule_engine/rebar.config +++ b/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, diff --git a/apps/emqx_rule_engine/test/emqx_rule_engine_api_rule_apply_SUITE.erl b/apps/emqx_rule_engine/test/emqx_rule_engine_api_rule_apply_SUITE.erl index 2b77f9c3d..576806464 100644 --- a/apps/emqx_rule_engine/test/emqx_rule_engine_api_rule_apply_SUITE.erl +++ b/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(),