test(refactor): move test to integration tests dir

This commit is contained in:
Thales Macedo Garitezi 2023-08-16 17:54:49 -03:00
parent c1f49abad2
commit ee2897e5de
3 changed files with 13 additions and 2 deletions

View File

@ -101,7 +101,13 @@ when
%% function will raise an error.
work_dir := file:name()
}.
start(Apps, SuiteOpts = #{work_dir := WorkDir}) ->
start(Apps, SuiteOpts0 = #{work_dir := WorkDir0}) ->
%% when running CT on the whole app, it seems like `priv_dir` is the same on all
%% suites and leads to the "clean slate" verificatin to fail.
WorkDir = binary_to_list(
filename:join([WorkDir0, emqx_guid:to_hexstr(emqx_guid:gen())])
),
SuiteOpts = SuiteOpts0#{work_dir := WorkDir},
% 1. Prepare appspec instructions
AppSpecs = [mk_appspec(App, SuiteOpts) || App <- Apps],
% 2. Load every app so that stuff scanning attributes of loaded modules works

View File

@ -29,9 +29,14 @@ all() ->
emqx_common_test_helpers:all(?MODULE).
init_per_suite(Config) ->
%% avoid inter-suite flakiness...
%% TODO: remove after other suites start to use `emx_cth_suite'
application:stop(emqx),
application:stop(emqx_durable_storage),
WorkDir = ?config(priv_dir, Config),
TCApps = emqx_cth_suite:start(
app_specs(),
#{work_dir => ?config(priv_dir, Config)}
#{work_dir => WorkDir}
),
[{tc_apps, TCApps} | Config].