Silence supervisor crash reports in test suite
parent
fb118002e4
commit
5ef5bb7b91
|
@ -8,6 +8,10 @@ config :farmbot_firmware, FarmbotFirmware, reset: FarmbotFirmware.NullReset
|
|||
config :farmbot_celery_script, FarmbotCeleryScript.SysCalls,
|
||||
sys_calls: FarmbotCeleryScript.SysCalls.Stubs
|
||||
|
||||
if Mix.env() == :test do
|
||||
import_config "test.exs"
|
||||
end
|
||||
|
||||
import_config "ecto.exs"
|
||||
import_config "farmbot_core.exs"
|
||||
import_config "lagger.exs"
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
use Mix.Config
|
||||
|
||||
config :farmbot_ext, FarmbotExt.Bootstrap.Supervisor, children: []
|
|
@ -136,7 +136,8 @@ defmodule FarmbotExt.AMQP.AutoSyncChannel do
|
|||
id = data["id"] || String.to_integer(id_str)
|
||||
_ = handle_asset(asset_kind, id, body)
|
||||
|
||||
_ -> ""
|
||||
_ ->
|
||||
""
|
||||
# Logger.info("ignoring route: #{key}")
|
||||
end
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
defmodule FarmbotExt.Bootstrap.Supervisor do
|
||||
@moduledoc """
|
||||
Supervisor responsible for starting all
|
||||
Supervisor responsible for starting all
|
||||
the tasks and processes that require authentication.
|
||||
"""
|
||||
use Supervisor
|
||||
|
@ -12,7 +12,14 @@ defmodule FarmbotExt.Bootstrap.Supervisor do
|
|||
|
||||
@impl Supervisor
|
||||
def init([]) do
|
||||
children = [
|
||||
Supervisor.init(children(), strategy: :one_for_one)
|
||||
end
|
||||
|
||||
# This only exists because I was getting too many crashed
|
||||
# supervisor reports in the test suite (distraction from
|
||||
# real test failures).
|
||||
def children do
|
||||
default = [
|
||||
FarmbotExt.API.EagerLoader.Supervisor,
|
||||
FarmbotExt.API.DirtyWorker.Supervisor,
|
||||
FarmbotExt.AMQP.Supervisor,
|
||||
|
@ -20,7 +27,7 @@ defmodule FarmbotExt.Bootstrap.Supervisor do
|
|||
FarmbotExt.Bootstrap.DropPasswordTask
|
||||
]
|
||||
|
||||
opts = [strategy: :one_for_one]
|
||||
Supervisor.init(children, opts)
|
||||
config = Application.get_env(:farmbot_ext, __MODULE__) || []
|
||||
Keyword.get(config, :children, default)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
defmodule AutoSyncChannelTest do
|
||||
|
||||
import ExUnit.CaptureIO
|
||||
|
||||
alias FarmbotExt.AMQP.AutoSyncChannel
|
||||
|
||||
use ExUnit.Case, async: true
|
||||
|
@ -12,6 +9,7 @@ defmodule AutoSyncChannelTest do
|
|||
API.Preloader,
|
||||
AMQP.ConnectionWorker
|
||||
}
|
||||
|
||||
setup :verify_on_exit!
|
||||
setup :set_mimic_global
|
||||
|
||||
|
|
|
@ -15,9 +15,11 @@ defmodule FarmbotExt.AMQP.BotStateChannelTest do
|
|||
test "terminate" do
|
||||
expected = "Disconnected from BotState channel: \"foo\""
|
||||
expect(AMQP.Channel, :close, 1, fn "fake_chan_" -> :ok end)
|
||||
|
||||
expect(FarmbotCore.LogExecutor, :execute, 1, fn log ->
|
||||
assert log.message == expected
|
||||
end)
|
||||
|
||||
FarmbotExt.AMQP.BotStateChannel.terminate("foo", %FakeState{})
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
defmodule FarmbotExt.API.ViewTest do
|
||||
use ExUnit.Case
|
||||
use ExUnit.Case
|
||||
|
||||
def render(%{ok: :ok}) do
|
||||
:yep
|
||||
end
|
||||
|
||||
test "render/2" do
|
||||
result = FarmbotExt.API.View.render(__MODULE__, %{ok: :ok})
|
||||
assert :yep == result
|
||||
end
|
||||
def render(%{ok: :ok}) do
|
||||
:yep
|
||||
end
|
||||
|
||||
|
||||
test "render/2" do
|
||||
result = FarmbotExt.API.View.render(__MODULE__, %{ok: :ok})
|
||||
assert :yep == result
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue