Skip to content

Commit 1d6a792

Browse files
committed
Fix plugin bug in test suites
`rabbit` is not a plugin. ``` make run-broker RABBITMQ_ENABLED_PLUGINS=rabbit rabbitmq-plugins enable rabbitmq_amqp1_0 Enabling plugins on node rabbit@nuc: rabbitmq_amqp1_0 Error: {:plugins_not_found, [:rabbit]} ``` Instead, we want: ``` make run-broker LEAVE_PLUGINS_DISABLED=1 rabbitmq-plugins enable rabbitmq_amqp1_0 Enabling plugins on node rabbit@nuc: rabbitmq_amqp1_0 The following plugins have been configured: rabbitmq_amqp1_0 Applying plugin configuration to rabbit@nuc... The following plugins have been enabled: rabbitmq_amqp1_0 started 1 plugins. ``` This commit allows enabling plugins on the old node in mixed version tests from tests in app `rabbit`. Previously this failed with above error: ``` {:plugins_not_found, [:rabbit]} ``` This feature will be needed for branch native-amqp which needs to enable the AMQP 1.0 plugin on the old node in tests of app `rabbit` (since the plugin on the new node moved to `rabbit`).
1 parent b9cac83 commit 1d6a792

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

deps/rabbitmq_ct_helpers/src/rabbit_ct_broker_helpers.erl

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ do_start_rabbitmq_node(Config, NodeConfig, I) ->
756756
NodeConfig1 = rabbit_ct_helpers:set_config(
757757
NodeConfig,
758758
[{effective_srcdir, SrcDir},
759-
{make_vars_for_node_startup, MakeVars}]),
759+
{make_vars_for_node_startup, MakeVars}]),
760760
query_node(Config, NodeConfig1);
761761
_ ->
762762
AbortCmd = ["stop-node" | MakeVars],
@@ -766,19 +766,24 @@ do_start_rabbitmq_node(Config, NodeConfig, I) ->
766766
RunCmd ->
767767
UseSecondary = CanUseSecondary andalso
768768
rabbit_ct_helpers:get_config(Config, rabbitmq_run_secondary_cmd) =/= undefined,
769-
EnabledPluginsMakeVars = case {UseSecondary, WithPlugins} of
770-
{_, false} ->
771-
["RABBITMQ_ENABLED_PLUGINS=rabbit"];
772-
{true, _} ->
773-
[{"RABBITMQ_ENABLED_PLUGINS=~ts", [filename:basename(SrcDir)]}];
774-
_ ->
775-
[]
776-
end,
769+
PluginsMakeVars = case {UseSecondary, WithPlugins} of
770+
{_, false} ->
771+
["LEAVE_PLUGINS_DISABLED=1"];
772+
{true, _} ->
773+
case filename:basename(SrcDir) of
774+
"rabbit" ->
775+
["LEAVE_PLUGINS_DISABLED=1"];
776+
Plugin ->
777+
[{"RABBITMQ_ENABLED_PLUGINS=~ts", [Plugin]}]
778+
end;
779+
_ ->
780+
[]
781+
end,
777782
RmqRun = case CanUseSecondary of
778-
false -> RunCmd;
779-
_ -> rabbit_ct_helpers:get_config(Config, rabbitmq_run_secondary_cmd, RunCmd)
780-
end,
781-
case rabbit_ct_helpers:exec([RmqRun, "-C", SrcDir] ++ EnabledPluginsMakeVars ++ Cmd) of
783+
false -> RunCmd;
784+
_ -> rabbit_ct_helpers:get_config(Config, rabbitmq_run_secondary_cmd, RunCmd)
785+
end,
786+
case rabbit_ct_helpers:exec([RmqRun, "-C", SrcDir] ++ PluginsMakeVars ++ Cmd) of
782787
{ok, _} ->
783788
NodeConfig1 = rabbit_ct_helpers:set_config(
784789
NodeConfig,

0 commit comments

Comments
 (0)