Skip to content

Commit a826eed

Browse files
committed
rabbit_feature_flags: Make several fixes to enable_feature_flag_when_ff_file_is_unwritable testcase
The testcase was moved to another testsuite but called functions from its initial testsuite. That code code relies on the name of the testsuite so it broke. At the same time, make it depend on the testsuite's feature flag, not stream queues. The stream queues feature flag will become required at some point and break the testcase.
1 parent 3b05391 commit a826eed

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

deps/rabbit/test/feature_flags_SUITE.erl

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -589,14 +589,14 @@ enable_unsupported_feature_flag_in_a_healthy_situation(Config) ->
589589

590590
enable_feature_flag_when_ff_file_is_unwritable(Config) ->
591591
Supported = rabbit_ct_broker_helpers:is_feature_flag_supported(
592-
Config, stream_queue),
592+
Config, ff_from_testsuite),
593593
case Supported of
594594
true -> do_enable_feature_flag_when_ff_file_is_unwritable(Config);
595-
false -> {skip, "Stream queues are unsupported"}
595+
false -> {skip, "Test feature flag is unsupported"}
596596
end.
597597

598598
do_enable_feature_flag_when_ff_file_is_unwritable(Config) ->
599-
FeatureName = stream_queue,
599+
FeatureName = ff_from_testsuite,
600600
ClusterSize = ?config(rmq_nodes_count, Config),
601601
Node = ClusterSize - 1,
602602
True = lists:duplicate(ClusterSize, true),
@@ -1127,14 +1127,19 @@ prepare_my_plugin(Config) ->
11271127
false ->
11281128
build_my_plugin(Config);
11291129
_ ->
1130-
MyPluginDir = filename:dirname(filename:dirname(code:where_is_file("my_plugin.app"))),
1130+
MyPluginDir = filename:dirname(
1131+
filename:dirname(
1132+
code:where_is_file("my_plugin.app"))),
11311133
PluginsDir = filename:dirname(MyPluginDir),
1132-
rabbit_ct_helpers:set_config(Config,
1133-
[{rmq_plugins_dir, PluginsDir}])
1134+
rabbit_ct_helpers:set_config(
1135+
Config, [{rmq_plugins_dir, PluginsDir}])
11341136
end.
11351137

11361138
build_my_plugin(Config) ->
1137-
PluginSrcDir = filename:join(?config(data_dir, Config), "my_plugin"),
1139+
DataDir = filename:join(
1140+
filename:dirname(filename:dirname(?config(data_dir, Config))),
1141+
?MODULE_STRING ++ "_data"),
1142+
PluginSrcDir = filename:join(DataDir, "my_plugin"),
11381143
PluginsDir = filename:join(PluginSrcDir, "plugins"),
11391144
Config1 = rabbit_ct_helpers:set_config(Config,
11401145
[{rmq_plugins_dir, PluginsDir}]),

deps/rabbit/test/feature_flags_with_unpriveleged_user_SUITE.erl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ init_per_suite(Config) ->
5353
end_per_suite(Config) ->
5454
feature_flags_SUITE:end_per_suite(Config).
5555

56-
init_per_group(enabling_in_cluster, Config) ->
57-
rabbit_ct_helpers:set_config(
58-
Config,
59-
[{rmq_nodes_count, 3}]);
6056
init_per_group(Group, Config) ->
6157
feature_flags_SUITE:init_per_group(Group, Config).
6258

0 commit comments

Comments
 (0)