-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The hook would check if MIM is running before init_per_suite for each big test It would check it for nodes requested by setting TEST_HOSTS variable --one-node flag still works as expected To disable this check use new --skip-validate-nodes flag It is compatible with cth_surefire
- Loading branch information
1 parent
b344d90
commit 42c3067
Showing
6 changed files
with
93 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
-module(cth_validate_nodes). | ||
|
||
%% Callbacks | ||
-export([id/1]). | ||
-export([init/2]). | ||
|
||
-export([pre_init_per_suite/3]). | ||
-export([terminate/1]). | ||
|
||
-record(state, {}). | ||
|
||
%% CT callbacks | ||
|
||
id(_Opts) -> | ||
"cth_validate_nodes_001". | ||
|
||
init(_Id, _Opts) -> | ||
{ok, #state{}}. | ||
|
||
pre_init_per_suite(_Suite, Config, State) -> | ||
case distributed_helper:validate_nodes() of | ||
ok -> | ||
{Config, State}; | ||
{error, Reason} -> | ||
case os:getenv("SKIP_VALIDATE_NODES") of | ||
"true" -> | ||
ct:pal("Skip failing with ~p in ct_check_rpc_nodes", [Reason]), | ||
{Config, State}; | ||
_ -> | ||
{{fail, Reason}, State} | ||
end | ||
end. | ||
|
||
terminate(_State) -> | ||
ok. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters