Skip to content

Commit aab0c4b

Browse files
committed
wip
1 parent b1adabe commit aab0c4b

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

deps/rabbitmq_ct_helpers/src/rabbit_ct_broker_helpers.erl

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -795,17 +795,30 @@ do_start_rabbitmq_node(Config, NodeConfig, I) ->
795795
{_, undefined, SrcPlugin} -> SrcPlugin;
796796
{_, SecondaryEnabledPlugins0, _} -> SecondaryEnabledPlugins0
797797
end,
798-
RequiredFeatureFlags = string:join(
799-
[atom_to_list(F) ||
800-
F <- ?REQUIRED_FEATURE_FLAGS],
801-
","),
798+
%% TODO: When we start to do mixed-version
799+
%% testing against 4.1.x as the secondary
800+
%% umbrella, we will need to stop setting
801+
%% `$RABBITMQ_FEATURE_FLAGS'.
802+
MetadataStore = rabbit_ct_helpers:get_config(
803+
Config, metadata_store),
804+
FeatureFlags = case MetadataStore of
805+
mnesia ->
806+
?REQUIRED_FEATURE_FLAGS;
807+
khepri ->
808+
[khepri_db |
809+
?REQUIRED_FEATURE_FLAGS]
810+
end,
811+
FeatureFlags1 = string:join(
812+
[atom_to_list(F) ||
813+
F <- FeatureFlags],
814+
","),
802815
[{"DIST_DIR=~ts/plugins", [SecondaryDist]},
803816
{"CLI_SCRIPTS_DIR=~ts/sbin", [SecondaryDist]},
804817
{"CLI_ESCRIPTS_DIR=~ts/escript", [SecondaryDist]},
805818
{"RABBITMQ_SCRIPTS_DIR=~ts/sbin", [SecondaryDist]},
806819
{"RABBITMQ_SERVER=~ts/sbin/rabbitmq-server", [SecondaryDist]},
807820
{"RABBITMQ_ENABLED_PLUGINS=~ts", [SecondaryEnabledPlugins]},
808-
{"RABBITMQ_FEATURE_FLAGS=~ts", [RequiredFeatureFlags]}
821+
{"RABBITMQ_FEATURE_FLAGS=~ts", [FeatureFlags1]}
809822
| ExtraArgs4];
810823
false ->
811824
ExtraArgs4
@@ -1058,6 +1071,14 @@ configure_metadata_store(Config) ->
10581071
%% However, RabbitMQ 4.0.x and older don't support it. See the
10591072
%% `uses_expected_metadata_store/2' check to see how Khepri is enabled in
10601073
%% this case.
1074+
%%
1075+
%% Note that this setting will be ignored by the secondary umbrella because
1076+
%% we set `$RABBITMQ_FEATURE_FLAGS' explisitly. In this case, we handle the
1077+
%% `khepri_db' feature flag when we compute the value of that variable.
1078+
%%
1079+
%% TODO: When we start to do mixed-version testing against 4.1.x as the
1080+
%% secondary umbrella, we will need to stop setting
1081+
%% `$RABBITMQ_FEATURE_FLAGS'.
10611082
case MetadataStore of
10621083
khepri ->
10631084
ct:log("Enabling Khepri metadata store"),
@@ -1067,7 +1088,7 @@ configure_metadata_store(Config) ->
10671088
Config1,
10681089
{rabbit,
10691090
[{forced_feature_flags_on_init,
1070-
[khepri_db | ?REQUIRED_FEATURE_FLAGS]}]});
1091+
{rel, [khepri_db], []}}]});
10711092
_ ->
10721093
rabbit_ct_helpers:merge_app_env(
10731094
Config1,
@@ -1083,7 +1104,7 @@ configure_metadata_store(Config) ->
10831104
Config1,
10841105
{rabbit,
10851106
[{forced_feature_flags_on_init,
1086-
?REQUIRED_FEATURE_FLAGS}]});
1107+
{rel, [], [khepri_db]}}]});
10871108
_ ->
10881109
rabbit_ct_helpers:merge_app_env(
10891110
Config1,

0 commit comments

Comments
 (0)