Skip to content

Commit

Permalink
Merge pull request #3548 from esl/config-parser-test-fix
Browse files Browse the repository at this point in the history
Do not silently skip wrong elements in tested options
  • Loading branch information
NelsonVides committed Feb 17, 2022
2 parents aeeff77 + ce17901 commit 077fbe2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
8 changes: 1 addition & 7 deletions big_tests/tests/inbox_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,7 @@ init_per_suite(Config0) ->
domain_helper:host_type(), inbox_modules()),
ok = dynamic_modules:ensure_modules(
ct:get_config({hosts, mim, secondary_host_type}),
[{mod_inbox,
#{backend => rdbms,
groupchat => [muclight],
aff_changes => false,
remove_on_kicked => true,
reset_markers => [<<"displayed">>],
iqdisc => no_queue}}]),
[{mod_inbox, (inbox_opts())#{aff_changes := false}}]),
InboxOptions = inbox_opts(),
mongoose_helper:inject_module(?MODULE),
escalus:init_per_suite([{inbox_opts, InboxOptions} | Config1]).
Expand Down
10 changes: 5 additions & 5 deletions test/config_parser_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1722,13 +1722,13 @@ mod_inbox(_Config) ->
P = [modules, mod_inbox],
T = fun(Opts) -> #{<<"modules">> => #{<<"mod_inbox">> => Opts}} end,
ChatMarkers = [<<"displayed">>, <<"received">>, <<"acknowledged">>],
?cfgh(P ++ [reset_markers, ChatMarkers],
?cfgh(P ++ [reset_markers], ChatMarkers,
T(#{<<"reset_markers">> => ChatMarkers})),
?cfgh(P ++ [groupchat, [muc, muclight]],
?cfgh(P ++ [groupchat], [muc, muclight],
T(#{<<"groupchat">> => [<<"muc">>, <<"muclight">>]})),
?cfgh(P ++ [aff_changes, true],
?cfgh(P ++ [aff_changes], true,
T(#{<<"aff_changes">> => true})),
?cfgh(P ++ [remove_on_kicked, false],
?cfgh(P ++ [remove_on_kicked], false,
T(#{<<"remove_on_kicked">> => false})),
?errh(T(#{<<"reset_markers">> => 1})),
?errh(T(#{<<"reset_markers">> => [<<"destroyed">>]})),
Expand Down Expand Up @@ -3204,7 +3204,7 @@ maybe_insert_dummy_domain(M) ->
-spec host_opts([{key_prefix(), mongoose_config:value()}]) ->
[{mongoose_config:key() | mongoose_config:key_path(), mongoose_config:value()}].
host_opts(ExpectedOptions) ->
[{host_key(Key), Value} || {Key, Value} <- ExpectedOptions].
lists:map(fun({Key, Value}) -> {host_key(Key), Value} end, ExpectedOptions).

%% @doc Build full per-host config key for host-or-global options
-spec host_key(top_level_key_prefix()) -> mongoose_config:key();
Expand Down

0 comments on commit 077fbe2

Please sign in to comment.