Skip to content

Commit 4903573

Browse files
committed
cli
1 parent 5b943f7 commit 4903573

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

deps/rabbitmq_cli/test/diagnostics/schema_info_command_test.exs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,35 +21,30 @@ defmodule SchemaInfoCommandTest do
2121
}
2222
end
2323

24-
@tag :mnesia
2524
test "merge_defaults: adds all keys if none specificed", context do
2625
default_keys = ~w(name cookie active_replicas user_properties)
2726

2827
{keys, _} = @command.merge_defaults([], context[:opts])
2928
assert default_keys == keys
3029
end
3130

32-
@tag :mnesia
3331
test "merge_defaults: includes table headers by default", _context do
3432
{_, opts} = @command.merge_defaults([], %{})
3533
assert opts[:table_headers]
3634
end
3735

38-
@tag :mnesia
3936
test "validate: returns bad_info_key on a single bad arg", context do
4037
assert @command.validate(["quack"], context[:opts]) ==
4138
{:validation_failure, {:bad_info_key, [:quack]}}
4239
end
4340

44-
@tag :mnesia
4541
test "validate: returns multiple bad args return a list of bad info key values", context do
4642
result = @command.validate(["quack", "oink"], context[:opts])
4743
assert match?({:validation_failure, {:bad_info_key, _}}, result)
4844
{_, {_, keys}} = result
4945
assert :lists.sort(keys) == [:oink, :quack]
5046
end
5147

52-
@tag :mnesia
5348
test "validate: return bad_info_key on mix of good and bad args", context do
5449
assert @command.validate(["quack", "cookie"], context[:opts]) ==
5550
{:validation_failure, {:bad_info_key, [:quack]}}
@@ -61,24 +56,28 @@ defmodule SchemaInfoCommandTest do
6156
{:validation_failure, {:bad_info_key, [:oink]}}
6257
end
6358

64-
@tag :mnesia
6559
@tag test_timeout: 0
6660
test "run: timeout causes command to return badrpc", context do
6761
assert run_command_to_list(@command, [["source_name"], context[:opts]]) ==
6862
{:badrpc, :timeout}
6963
end
7064

71-
@tag :mnesia
7265
test "run: can filter info keys", context do
73-
wanted_keys = ~w(name access_mode)
74-
75-
assert match?(
76-
[[name: _, access_mode: _] | _],
77-
run_command_to_list(@command, [wanted_keys, context[:opts]])
78-
)
66+
node = context[:opts][:node]
67+
case :rabbit_misc.rpc_call(node, :rabbit_khepri, :is_enabled, []) do
68+
true ->
69+
:ok
70+
71+
false ->
72+
wanted_keys = ~w(name access_mode)
73+
74+
assert match?(
75+
[[name: _, access_mode: _] | _],
76+
run_command_to_list(@command, [wanted_keys, context[:opts]])
77+
)
78+
end
7979
end
8080

81-
@tag :mnesia
8281
test "banner" do
8382
assert String.starts_with?(@command.banner([], %{node: "node@node"}), "Asking node")
8483
end

0 commit comments

Comments
 (0)