Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kansi committed Sep 10, 2024
1 parent 121071e commit b2d34c8
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 16 deletions.
7 changes: 7 additions & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Config

# Configures Elixir's Logger
config :logger, :console,
level: :info,
format: "$time $metadata[$level] $message\n",
metadata: :all
4 changes: 2 additions & 2 deletions test/control_node/namespace/deploy_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ defmodule ControlNode.Namespace.DeployTest do
test "transitions to [state: :initialize] after failing to terminate deployment" do
data = build_workflow_data("0.1.0")

assert {:next_state, :initialize, data, next_actions} =
assert {:next_state, :initialize, _data, next_actions} =
Namespace.Deploy.handle_event(:internal, {:ensure_running, "0.2.0"}, :ignore, data)

assert next_actions == expected_actions("0.2.0")
Expand All @@ -66,7 +66,7 @@ defmodule ControlNode.Namespace.DeployTest do
test "transitions to [state: :initialize] after failing to start deployment" do
data = build_workflow_data("0.2.0")

assert {:next_state, :initialize, data, next_actions} =
assert {:next_state, :initialize, _data, next_actions} =
Namespace.Deploy.handle_event(:internal, {:ensure_running, "0.3.0"}, :ignore, data)

assert next_actions == expected_actions("0.3.0")
Expand Down
16 changes: 8 additions & 8 deletions test/control_node/namespace/initialize_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ defmodule ControlNode.Namespace.InitializeTest do
]

with_mock Release, initialize_state: &mock_initialize_state/3 do
assert {:next_state, :manage, data, next_actions} =
assert {:next_state, :manage, _data, next_actions} =
Initialize.handle_event(:internal, :load_release_state, :initialize, data)

assert next_actions == actions
Expand All @@ -30,7 +30,7 @@ defmodule ControlNode.Namespace.InitializeTest do
actions = [{:change_callback_module, ControlNode.Namespace.Manage}]

with_mock Release, initialize_state: &mock_initialize_state/3 do
assert {:next_state, :manage, data, next_actions} =
assert {:next_state, :manage, _data, next_actions} =
Initialize.handle_event(:internal, :load_release_state, :initialize, data)

assert next_actions == actions
Expand All @@ -57,7 +57,7 @@ defmodule ControlNode.Namespace.InitializeTest do
{:next_event, :internal, :schedule_health_check}
]

assert {:next_state, :manage, data, next_actions} =
assert {:next_state, :manage, _data, next_actions} =
Initialize.handle_event(
:internal,
{:load_release_state, "0.1.0"},
Expand All @@ -72,7 +72,7 @@ defmodule ControlNode.Namespace.InitializeTest do
when release with `version` is not running" do
data = build_workflow_data("localhost3")

assert {:next_state, :deploy, data, next_actions} =
assert {:next_state, :deploy, _data, next_actions} =
Initialize.handle_event(
:internal,
{:load_release_state, "0.1.0"},
Expand All @@ -87,7 +87,7 @@ defmodule ControlNode.Namespace.InitializeTest do
when different release versions are running" do
data = build_workflow_data("localhost")

assert {:next_state, :deploy, data, next_actions} =
assert {:next_state, :deploy, _data, next_actions} =
Initialize.handle_event(
:internal,
{:load_release_state, "0.2.0"},
Expand All @@ -102,7 +102,7 @@ defmodule ControlNode.Namespace.InitializeTest do
when release is not running" do
data = build_workflow_data("localhost3")

assert {:next_state, :deploy, data, next_actions} =
assert {:next_state, :deploy, _data, next_actions} =
Initialize.handle_event(
:internal,
{:load_release_state, "0.2.0"},
Expand Down Expand Up @@ -170,7 +170,7 @@ defmodule ControlNode.Namespace.InitializeTest do
test "[event: :observe_namespace_state] transitions to [state: :observe]" do
data = build_workflow_data("localhost")

assert {:next_state, :observe, data, next_actions} =
assert {:next_state, :observe, _data, next_actions} =
Initialize.handle_event(:internal, :observe_release_state, :initialize, data)

assert next_actions == [{:change_callback_module, Namespace.Observe}]
Expand All @@ -179,7 +179,7 @@ defmodule ControlNode.Namespace.InitializeTest do
test "[event: :connect_namespace_state] transitions to [state: :connect]" do
data = build_workflow_data("localhost")

assert {:next_state, :connect, data, next_actions} =
assert {:next_state, :connect, _data, next_actions} =
Initialize.handle_event(:internal, :connect_release_state, :initialize, data)

assert next_actions == [{:change_callback_module, Namespace.Connect}]
Expand Down
6 changes: 3 additions & 3 deletions test/control_node/namespace/manage_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ defmodule ControlNode.Namespace.ManageTest do

action = [{:reply, :sender_pid, :ok}]

assert {:next_state, :manage, data, ^action} =
assert {:next_state, :manage, _data, ^action} =
Manage.handle_event({:call, :sender_pid}, :stop, :ignore, data)
end
end
Expand All @@ -99,7 +99,7 @@ defmodule ControlNode.Namespace.ManageTest do
test "performs health check and keeps state when health check passes" do
data = build_workflow_data("localhost2")

assert {:keep_state, data, []} =
assert {:keep_state, _data, []} =
Manage.handle_event(:internal, :check_health, :ignore, data)
end

Expand All @@ -124,7 +124,7 @@ defmodule ControlNode.Namespace.ManageTest do

data = %{build_workflow_data("localhost3") | release_spec: release_spec}

assert {:keep_state, data, []} =
assert {:keep_state, _data, []} =
Manage.handle_event(:internal, :check_health, :ignore, data)
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/control_node/release_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ defmodule ControlNode.ReleaseTest do
mock_rpc_call = {:erpc, [:unstick], [call: &rpc_call/4]}

with_mocks([mock_rpc_call]) do
assert %Release.State{host: host_spec, version: "0.1.0", status: :running} =
assert %Release.State{host: _host_spec, version: "0.1.0", status: :running} =
Release.initialize_state(release_spec, host_spec, cookie)
end

Expand Down
4 changes: 2 additions & 2 deletions test/fixture/config/ssh_host_keys/sshd_config
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# possible, but leave them commented. Uncommented options override the
# default value.

#Port 22
Port 2222
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
Expand Down Expand Up @@ -107,7 +107,7 @@ PidFile /config/sshd.pid
#Banner none

# override default of no subsystems
Subsystem sftp /usr/lib/ssh/sftp-server
Subsystem sftp /usr/lib/ssh/sftp-server -u 022

# Example of overriding settings on a per-user basis
#Match User anoncvs
Expand Down

0 comments on commit b2d34c8

Please sign in to comment.