Skip to content

Commit c9d080f

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`). (cherry picked from commit 1d6a792)
1 parent 50020f4 commit c9d080f

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
@@ -750,7 +750,7 @@ do_start_rabbitmq_node(Config, NodeConfig, I) ->
750750
NodeConfig1 = rabbit_ct_helpers:set_config(
751751
NodeConfig,
752752
[{effective_srcdir, SrcDir},
753-
{make_vars_for_node_startup, MakeVars}]),
753+
{make_vars_for_node_startup, MakeVars}]),
754754
query_node(Config, NodeConfig1);
755755
_ ->
756756
AbortCmd = ["stop-node" | MakeVars],
@@ -760,19 +760,24 @@ do_start_rabbitmq_node(Config, NodeConfig, I) ->
760760
RunCmd ->
761761
UseSecondary = CanUseSecondary andalso
762762
rabbit_ct_helpers:get_config(Config, rabbitmq_run_secondary_cmd) =/= undefined,
763-
EnabledPluginsMakeVars = case {UseSecondary, WithPlugins} of
764-
{_, false} ->
765-
["RABBITMQ_ENABLED_PLUGINS=rabbit"];
766-
{true, _} ->
767-
[{"RABBITMQ_ENABLED_PLUGINS=~ts", [filename:basename(SrcDir)]}];
768-
_ ->
769-
[]
770-
end,
763+
PluginsMakeVars = case {UseSecondary, WithPlugins} of
764+
{_, false} ->
765+
["LEAVE_PLUGINS_DISABLED=1"];
766+
{true, _} ->
767+
case filename:basename(SrcDir) of
768+
"rabbit" ->
769+
["LEAVE_PLUGINS_DISABLED=1"];
770+
Plugin ->
771+
[{"RABBITMQ_ENABLED_PLUGINS=~ts", [Plugin]}]
772+
end;
773+
_ ->
774+
[]
775+
end,
771776
RmqRun = case CanUseSecondary of
772-
false -> RunCmd;
773-
_ -> rabbit_ct_helpers:get_config(Config, rabbitmq_run_secondary_cmd, RunCmd)
774-
end,
775-
case rabbit_ct_helpers:exec([RmqRun, "-C", SrcDir] ++ EnabledPluginsMakeVars ++ Cmd) of
777+
false -> RunCmd;
778+
_ -> rabbit_ct_helpers:get_config(Config, rabbitmq_run_secondary_cmd, RunCmd)
779+
end,
780+
case rabbit_ct_helpers:exec([RmqRun, "-C", SrcDir] ++ PluginsMakeVars ++ Cmd) of
776781
{ok, _} ->
777782
NodeConfig1 = rabbit_ct_helpers:set_config(
778783
NodeConfig,

0 commit comments

Comments
 (0)