mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-11-22 01:19:54 +08:00
Remove warnings in more recent Elixir versions
This commit is contained in:
parent
ae4466472a
commit
64b03396e3
9 changed files with 6 additions and 17 deletions
|
|
@ -15,8 +15,6 @@ defmodule Livebook.Runtime.Evaluator do
|
|||
# and we want to keep them in the inbox, whereas a GenServer would
|
||||
# always consume them.
|
||||
|
||||
require Logger
|
||||
|
||||
alias Livebook.Runtime.Evaluator
|
||||
|
||||
@type t :: %{pid: pid(), ref: reference()}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
defmodule Livebook.ZTA.LivebookTeams do
|
||||
use LivebookWeb, :verified_routes
|
||||
|
||||
require Logger
|
||||
|
||||
alias Livebook.Teams
|
||||
|
||||
import Plug.Conn
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
defmodule LivebookWeb.SidebarHook do
|
||||
use LivebookWeb, :verified_routes
|
||||
require Logger
|
||||
|
||||
import Phoenix.Component
|
||||
import Phoenix.LiveView
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
defmodule LivebookWeb.VerifiedRoutes do
|
||||
require Phoenix.VerifiedRoutes
|
||||
|
||||
defmacro sigil_p({:<<>>, _meta, ["/public/" <> _ | _]} = route, extra) do
|
||||
# We allow configuring a base path for all routes and we configure
|
||||
# Phoenix to use it. However, we have an additional configuration
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ defmodule Livebook.FileSystem.LocalTest do
|
|||
assert :ok = FileSystem.rename(file_system, src_file_path, dest_file_path)
|
||||
|
||||
assert File.read!(dest_file_path) == "content"
|
||||
refute File.exists?(src_file_path) == "content"
|
||||
refute File.exists?(src_file_path)
|
||||
end
|
||||
|
||||
@tag :tmp_dir
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@ defmodule Livebook.ZTA.TailscaleTest do
|
|||
|
||||
setup do
|
||||
bypass = Bypass.open()
|
||||
|
||||
conn = %Plug.Conn{conn(:get, @path) | remote_ip: {151, 236, 219, 228}}
|
||||
conn = %{conn(:get, @path) | remote_ip: {151, 236, 219, 228}}
|
||||
|
||||
options = [
|
||||
name: @name,
|
||||
|
|
@ -80,7 +79,7 @@ defmodule Livebook.ZTA.TailscaleTest do
|
|||
|> send_resp(404, "no match for IP:port")
|
||||
end)
|
||||
|
||||
conn = %Plug.Conn{conn(:get, @path) | remote_ip: {151, 236, 219, 229}}
|
||||
conn = %{conn(:get, @path) | remote_ip: {151, 236, 219, 229}}
|
||||
|
||||
start_supervised!({Tailscale, options})
|
||||
assert {_conn, nil} = Tailscale.authenticate(@name, conn, @fields)
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ defmodule Livebook.ZTA.LivebookTeamsTest do
|
|||
"failed_reason" => "you do not belong to this org"
|
||||
}
|
||||
|
||||
conn = %Plug.Conn{conn | params: params_from_teams}
|
||||
conn = %{conn | params: params_from_teams}
|
||||
|
||||
{conn, nil} = LivebookTeams.authenticate(test, conn, [])
|
||||
assert conn.status == 302
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@ defmodule LivebookWeb.ProxyPlugTest do
|
|||
use LivebookWeb.ConnCase, async: true
|
||||
|
||||
# Integration tests for proxying requests to the runtime.
|
||||
|
||||
require Phoenix.LiveViewTest
|
||||
import Livebook.AppHelpers
|
||||
|
||||
alias Livebook.Notebook
|
||||
|
|
|
|||
|
|
@ -199,12 +199,11 @@ defmodule Livebook.TeamsIntegrationHelper do
|
|||
|> get("/", %{teams_identity: "", code: code})
|
||||
|> Plug.Conn.get_session()
|
||||
|
||||
authenticated_conn = Plug.Test.init_test_session(conn, session)
|
||||
authenticated_conn = %Plug.Conn{} = Plug.Test.init_test_session(conn, session)
|
||||
final_conn = get(authenticated_conn, "/")
|
||||
assigns = Map.take(final_conn.assigns, [:current_user])
|
||||
|
||||
{%Plug.Conn{authenticated_conn | assigns: Map.merge(authenticated_conn.assigns, assigns)},
|
||||
code}
|
||||
{%{authenticated_conn | assigns: Map.merge(authenticated_conn.assigns, assigns)}, code}
|
||||
end
|
||||
|
||||
def change_to_agent_session(%{node: node, teams_for: :user} = context) do
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue