Skip to content

Commit 01dad37

Browse files
authored
Merge pull request #4444 from esl/fix-dyn-domains-test-runner
Fix dynamic domains preset failing
2 parents 770a362 + 424fb5b commit 01dad37

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

big_tests/tests/domain_helper.erl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ delete_domain_password(Node, Domain) ->
7575
{ok, _} = rpc(Node, mongoose_domain_api, delete_domain_password, [Domain]).
7676

7777
for_each_configured_domain(F) ->
78-
[for_each_configured_domain(F, Opts) || {_, Opts} <- ct:get_config(hosts)],
78+
%% Skip nodes not specified in `--test-hosts'
79+
Keys = distributed_helper:get_node_keys(),
80+
[for_each_configured_domain(F, Opts)
81+
|| {Key, Opts} <- ct:get_config(hosts),
82+
lists:member(Key, Keys)],
7983
ok.
8084

8185
for_each_configured_domain(F, Opts) ->

test/common/distributed_helper.erl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,15 @@ wait_for_nodes_to_start(NodeKeys) ->
226226
name => wait_for_nodes_to_start}).
227227

228228
get_node_keys() ->
229+
Keys = [NodeKey || {NodeKey, _Opts} <- ct:get_config(hosts)],
229230
case os:getenv("TEST_HOSTS") of
230231
false ->
231-
[NodeKey || {NodeKey, _Opts} <- ct:get_config(hosts)];
232+
Keys;
232233
EnvValue -> %% EnvValue examples are "mim" or "mim mim2"
233234
BinHosts = binary:split(iolist_to_binary(EnvValue), <<" ">>, [global]),
234-
[binary_to_atom(Node, utf8) || Node <- BinHosts, Node =/= <<>>]
235+
EnvKeys = [binary_to_atom(Node, utf8) || Node <- BinHosts, Node =/= <<>>],
236+
%% Check only configured nodes (through test.config)
237+
[Key || Key <- EnvKeys, lists:member(Key, Keys)]
235238
end.
236239

237240
validate_node(NodeKey) ->

0 commit comments

Comments
 (0)