Skip to content

Commit 9fb0136

Browse files
Merge pull request #12894 from rabbitmq/md/cli-warnings
CLI: Error on compiler warnings in tests
2 parents 28b0b05 + 9b6ab77 commit 9fb0136

File tree

6 files changed

+5
-7
lines changed

6 files changed

+5
-7
lines changed

deps/rabbitmq_cli/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ VERBOSE_TEST ?= true
1717
MAX_CASES ?= 1
1818

1919
MIX_TEST_OPTS ?= ""
20-
MIX_TEST = ERL_COMPILER_OPTIONS=deterministic mix test --max-cases=$(MAX_CASES)
20+
MIX_TEST = ERL_COMPILER_OPTIONS=deterministic MIX_ENV=test mix do compile --warnings-as-errors, test --max-cases=$(MAX_CASES) --warnings-as-errors
2121

2222
ifneq ("",$(MIX_TEST_OPTS))
2323
MIX_TEST := $(MIX_TEST) $(MIX_TEST_OPTS)

deps/rabbitmq_cli/lib/rabbitmq/cli/auto_complete.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ defmodule RabbitMQ.CLI.AutoComplete do
9494

9595
defp complete_command_opts(command, <<"-", _::binary>> = opt) do
9696
switches =
97-
command.switches
97+
command.switches()
9898
|> Keyword.keys()
9999
|> Enum.map(fn sw -> "--" <> to_string(sw) end)
100100

deps/rabbitmq_cli/test/diagnostics/check_if_any_deprecated_features_are_used_command_test.exs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ defmodule CheckIfAnyDeprecatedFeaturesAreUsedCommandTest do
1010

1111
@command RabbitMQ.CLI.Diagnostics.Commands.CheckIfAnyDeprecatedFeaturesAreUsedCommand
1212
@policy_name "cmq-policy-8373"
13-
@policy_value "{\"ha-mode\":\"all\"}"
1413

1514
setup_all do
1615
RabbitMQ.CLI.Core.Distribution.start()

deps/rabbitmq_cli/test/diagnostics/check_if_cluster_has_classic_queue_mirroring_policy_command_test.exs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ defmodule CheckIfClusterHasClassicQueueMirroringPolicyCommandTest do
1010

1111
@command RabbitMQ.CLI.Diagnostics.Commands.CheckIfClusterHasClassicQueueMirroringPolicyCommand
1212
@policy_name "cmq-policy-8373"
13-
@policy_value "{\"ha-mode\":\"all\"}"
1413

1514
setup_all do
1615
RabbitMQ.CLI.Core.Distribution.start()

deps/rabbitmq_cli/test/diagnostics/discover_peers_command_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ defmodule DiscoverPeersCommandTest do
3737

3838
@tag test_timeout: 15000
3939
test "run: returns a list of nodes when the backend isn't configured", context do
40-
this_node = node()
41-
assert match?({:ok, {[this_node], _}}, @command.run([], context[:opts]))
40+
this_node = context.opts.node
41+
assert match?({:ok, {[^this_node], _}}, @command.run([], context[:opts]))
4242
end
4343
end

deps/rabbitmq_cli/test/rabbitmqctl_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ defmodule RabbitMQCtlTest do
121121

122122
test "short node name without the host part connects properly" do
123123
command = ["status", "-n", "rabbit"]
124-
capture_io(:stderr, fn -> error_check(command, exit_ok()) end)
124+
capture_io(:stdio, fn -> error_check(command, exit_ok()) end)
125125
end
126126

127127
test "a non-existent command results in help message displayed" do

0 commit comments

Comments
 (0)