mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-11-22 09:29:18 +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
|
# and we want to keep them in the inbox, whereas a GenServer would
|
||||||
# always consume them.
|
# always consume them.
|
||||||
|
|
||||||
require Logger
|
|
||||||
|
|
||||||
alias Livebook.Runtime.Evaluator
|
alias Livebook.Runtime.Evaluator
|
||||||
|
|
||||||
@type t :: %{pid: pid(), ref: reference()}
|
@type t :: %{pid: pid(), ref: reference()}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
defmodule Livebook.ZTA.LivebookTeams do
|
defmodule Livebook.ZTA.LivebookTeams do
|
||||||
use LivebookWeb, :verified_routes
|
use LivebookWeb, :verified_routes
|
||||||
|
|
||||||
require Logger
|
|
||||||
|
|
||||||
alias Livebook.Teams
|
alias Livebook.Teams
|
||||||
|
|
||||||
import Plug.Conn
|
import Plug.Conn
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
defmodule LivebookWeb.SidebarHook do
|
defmodule LivebookWeb.SidebarHook do
|
||||||
use LivebookWeb, :verified_routes
|
use LivebookWeb, :verified_routes
|
||||||
require Logger
|
|
||||||
|
|
||||||
import Phoenix.Component
|
import Phoenix.Component
|
||||||
import Phoenix.LiveView
|
import Phoenix.LiveView
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule LivebookWeb.VerifiedRoutes do
|
defmodule LivebookWeb.VerifiedRoutes do
|
||||||
require Phoenix.VerifiedRoutes
|
|
||||||
|
|
||||||
defmacro sigil_p({:<<>>, _meta, ["/public/" <> _ | _]} = route, extra) do
|
defmacro sigil_p({:<<>>, _meta, ["/public/" <> _ | _]} = route, extra) do
|
||||||
# We allow configuring a base path for all routes and we configure
|
# We allow configuring a base path for all routes and we configure
|
||||||
# Phoenix to use it. However, we have an additional configuration
|
# 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 :ok = FileSystem.rename(file_system, src_file_path, dest_file_path)
|
||||||
|
|
||||||
assert File.read!(dest_file_path) == "content"
|
assert File.read!(dest_file_path) == "content"
|
||||||
refute File.exists?(src_file_path) == "content"
|
refute File.exists?(src_file_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
@tag :tmp_dir
|
@tag :tmp_dir
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,7 @@ defmodule Livebook.ZTA.TailscaleTest do
|
||||||
|
|
||||||
setup do
|
setup do
|
||||||
bypass = Bypass.open()
|
bypass = Bypass.open()
|
||||||
|
conn = %{conn(:get, @path) | remote_ip: {151, 236, 219, 228}}
|
||||||
conn = %Plug.Conn{conn(:get, @path) | remote_ip: {151, 236, 219, 228}}
|
|
||||||
|
|
||||||
options = [
|
options = [
|
||||||
name: @name,
|
name: @name,
|
||||||
|
|
@ -80,7 +79,7 @@ defmodule Livebook.ZTA.TailscaleTest do
|
||||||
|> send_resp(404, "no match for IP:port")
|
|> send_resp(404, "no match for IP:port")
|
||||||
end)
|
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})
|
start_supervised!({Tailscale, options})
|
||||||
assert {_conn, nil} = Tailscale.authenticate(@name, conn, @fields)
|
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"
|
"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, [])
|
{conn, nil} = LivebookTeams.authenticate(test, conn, [])
|
||||||
assert conn.status == 302
|
assert conn.status == 302
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@ defmodule LivebookWeb.ProxyPlugTest do
|
||||||
use LivebookWeb.ConnCase, async: true
|
use LivebookWeb.ConnCase, async: true
|
||||||
|
|
||||||
# Integration tests for proxying requests to the runtime.
|
# Integration tests for proxying requests to the runtime.
|
||||||
|
|
||||||
require Phoenix.LiveViewTest
|
|
||||||
import Livebook.AppHelpers
|
import Livebook.AppHelpers
|
||||||
|
|
||||||
alias Livebook.Notebook
|
alias Livebook.Notebook
|
||||||
|
|
|
||||||
|
|
@ -199,12 +199,11 @@ defmodule Livebook.TeamsIntegrationHelper do
|
||||||
|> get("/", %{teams_identity: "", code: code})
|
|> get("/", %{teams_identity: "", code: code})
|
||||||
|> Plug.Conn.get_session()
|
|> 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, "/")
|
final_conn = get(authenticated_conn, "/")
|
||||||
assigns = Map.take(final_conn.assigns, [:current_user])
|
assigns = Map.take(final_conn.assigns, [:current_user])
|
||||||
|
|
||||||
{%Plug.Conn{authenticated_conn | assigns: Map.merge(authenticated_conn.assigns, assigns)},
|
{%{authenticated_conn | assigns: Map.merge(authenticated_conn.assigns, assigns)}, code}
|
||||||
code}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def change_to_agent_session(%{node: node, teams_for: :user} = context) do
|
def change_to_agent_session(%{node: node, teams_for: :user} = context) do
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue