ci: wait for redis in emqx_ee_bridge_redis_SUITE

This commit is contained in:
Zaiming (Stone) Shi 2023-01-02 20:37:38 +01:00
parent 0697c692ed
commit c3635f537a
3 changed files with 13 additions and 8 deletions

View File

@ -75,9 +75,9 @@ wait_for_redis(Checks) ->
wait_for_redis(Checks - 1)
end.
% %%------------------------------------------------------------------------------
% %% Testcases
% %%------------------------------------------------------------------------------
%%------------------------------------------------------------------------------
%% Testcases
%%------------------------------------------------------------------------------
t_single_lifecycle(_Config) ->
perform_lifecycle_check(

View File

@ -80,6 +80,12 @@ end_per_group(_Group, _Config) ->
ok.
init_per_suite(Config) ->
wait_for_ci_redis(redis_checks(), Config).
wait_for_ci_redis(0, _Config) ->
throw(no_redis);
wait_for_ci_redis(Checks, Config) ->
timer:sleep(1000),
TestHosts = all_test_hosts(),
case emqx_common_test_helpers:is_all_tcp_servers_available(TestHosts) of
true ->
@ -97,15 +103,15 @@ init_per_suite(Config) ->
| Config
];
false ->
assert_ci()
wait_for_ci_redis(Checks - 1, Config)
end.
assert_ci() ->
redis_checks() ->
case os:getenv("IS_CI") of
"yes" ->
throw(no_redis);
10;
_ ->
{skip, no_redis}
1
end.
end_per_suite(_Config) ->

View File

@ -11,7 +11,6 @@ help() {
echo
echo "-h|--help: To display this usage info"
echo "--app lib_dir/app_name: For which app to run start docker-compose, and run common tests"
echo "--suites SUITE1,SUITE2: Comma separated SUITE names to run. e.g. apps/emqx/test/emqx_SUITE.erl"
echo "--console: Start EMQX in console mode but do not run test cases"
echo "--attach: Attach to the Erlang docker container without running any test case"
echo "--stop: Stop running containers for the given app"