From 81d62f7401044278882f151ce0100683792b31de Mon Sep 17 00:00:00 2001 From: Jeremy Thurgood Date: Tue, 30 Jul 2024 17:43:02 +0200 Subject: [PATCH] Fix various deprecation warnings --- config/test.exs | 2 +- lib/turn_junebug_expressway/application.ex | 10 ++++------ mix.exs | 4 ++-- test/support/conn_case.ex | 2 +- test/support/data_case.ex | 2 -- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/config/test.exs b/config/test.exs index 8eb70bf..613f955 100644 --- a/config/test.exs +++ b/config/test.exs @@ -11,7 +11,7 @@ config :turn_junebug_expressway, rapidpro_client: TurnJunebugExpressway.Backends.ClientMock # Print only warnings and errors during test -config :logger, level: :warn +config :logger, level: :warning config :tesla, adapter: Tesla.Mock diff --git a/lib/turn_junebug_expressway/application.ex b/lib/turn_junebug_expressway/application.ex index 4411a4e..8edb90b 100644 --- a/lib/turn_junebug_expressway/application.ex +++ b/lib/turn_junebug_expressway/application.ex @@ -4,8 +4,6 @@ defmodule TurnJunebugExpressway.Application do # See https://hexdocs.pm/elixir/Application.html # for more information on OTP Applications def start(_type, _args) do - import Supervisor.Spec - # Metrics TurnJunebugExpresswayWeb.PhoenixInstrumenter.setup() TurnJunebugExpresswayWeb.PipelineInstrumenter.setup() @@ -14,11 +12,11 @@ defmodule TurnJunebugExpressway.Application do # Define workers and child supervisors to be supervised children = [ # Start the endpoint when the application starts - supervisor(TurnJunebugExpresswayWeb.Endpoint, []), + TurnJunebugExpresswayWeb.Endpoint, # Start your own worker by calling: TurnJunebugExpressway.Worker.start_link(arg1, arg2, arg3) - # worker(TurnJunebugExpressway.Worker, [arg1, arg2, arg3]), - worker(TurnJunebugExpressway.MessageEngine, []), - worker(TurnJunebugExpressway.HttpPushEngine, []), + # {TurnJunebugExpressway.Worker, [arg1, arg2, arg3]}, + {TurnJunebugExpressway.MessageEngine, name: TurnJunebugExpressway.MessageEngine}, + {TurnJunebugExpressway.HttpPushEngine, name: TurnJunebugExpressway.HttpPushEngine}, {Task.Supervisor, name: Task.ExpressSupervisor, restart: :transient} ] diff --git a/mix.exs b/mix.exs index df4b2e7..07a737c 100644 --- a/mix.exs +++ b/mix.exs @@ -5,9 +5,9 @@ defmodule TurnJunebugExpressway.Mixfile do [ app: :turn_junebug_expressway, version: "0.0.18", - elixir: "~> 1.9", + elixir: "~> 1.17", elixirc_paths: elixirc_paths(Mix.env()), - compilers: [:phoenix, :gettext] ++ Mix.compilers(), + compilers: [:gettext] ++ Mix.compilers(), start_permanent: Mix.env() == :prod, aliases: aliases(), deps: deps(), diff --git a/test/support/conn_case.ex b/test/support/conn_case.ex index 18bb62a..0939b7c 100644 --- a/test/support/conn_case.ex +++ b/test/support/conn_case.ex @@ -26,7 +26,7 @@ defmodule TurnJunebugExpresswayWeb.ConnCase do end end - setup tags do + setup _tags do {:ok, conn: Phoenix.ConnTest.build_conn()} end end diff --git a/test/support/data_case.ex b/test/support/data_case.ex index 6a2510e..73775a3 100644 --- a/test/support/data_case.ex +++ b/test/support/data_case.ex @@ -14,8 +14,6 @@ defmodule TurnJunebugExpressway.DataCase do use ExUnit.CaseTemplate - alias Ecto.Adapters.SQL.Sandbox - using do quote do import Ecto