ci: wait for redis in emqx_ee_bridge_redis_SUITE
This commit is contained in:
parent
0697c692ed
commit
c3635f537a
|
@ -75,9 +75,9 @@ wait_for_redis(Checks) ->
|
||||||
wait_for_redis(Checks - 1)
|
wait_for_redis(Checks - 1)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
% %%------------------------------------------------------------------------------
|
%%------------------------------------------------------------------------------
|
||||||
% %% Testcases
|
%% Testcases
|
||||||
% %%------------------------------------------------------------------------------
|
%%------------------------------------------------------------------------------
|
||||||
|
|
||||||
t_single_lifecycle(_Config) ->
|
t_single_lifecycle(_Config) ->
|
||||||
perform_lifecycle_check(
|
perform_lifecycle_check(
|
||||||
|
|
|
@ -80,6 +80,12 @@ end_per_group(_Group, _Config) ->
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
init_per_suite(Config) ->
|
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(),
|
TestHosts = all_test_hosts(),
|
||||||
case emqx_common_test_helpers:is_all_tcp_servers_available(TestHosts) of
|
case emqx_common_test_helpers:is_all_tcp_servers_available(TestHosts) of
|
||||||
true ->
|
true ->
|
||||||
|
@ -97,15 +103,15 @@ init_per_suite(Config) ->
|
||||||
| Config
|
| Config
|
||||||
];
|
];
|
||||||
false ->
|
false ->
|
||||||
assert_ci()
|
wait_for_ci_redis(Checks - 1, Config)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
assert_ci() ->
|
redis_checks() ->
|
||||||
case os:getenv("IS_CI") of
|
case os:getenv("IS_CI") of
|
||||||
"yes" ->
|
"yes" ->
|
||||||
throw(no_redis);
|
10;
|
||||||
_ ->
|
_ ->
|
||||||
{skip, no_redis}
|
1
|
||||||
end.
|
end.
|
||||||
|
|
||||||
end_per_suite(_Config) ->
|
end_per_suite(_Config) ->
|
||||||
|
|
|
@ -11,7 +11,6 @@ help() {
|
||||||
echo
|
echo
|
||||||
echo "-h|--help: To display this usage info"
|
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 "--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 "--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 "--attach: Attach to the Erlang docker container without running any test case"
|
||||||
echo "--stop: Stop running containers for the given app"
|
echo "--stop: Stop running containers for the given app"
|
||||||
|
|
Loading…
Reference in New Issue