2023-05-17 00:21:49 +08:00
|
|
|
defmodule Livebook.TeamsIntegrationCase do
|
|
|
|
use ExUnit.CaseTemplate
|
|
|
|
|
|
|
|
alias Livebook.TeamsServer
|
|
|
|
|
|
|
|
using do
|
|
|
|
quote do
|
|
|
|
use Livebook.DataCase
|
|
|
|
use LivebookWeb.ConnCase
|
|
|
|
|
|
|
|
@moduletag :teams_integration
|
|
|
|
|
|
|
|
alias Livebook.TeamsServer
|
2023-07-27 04:39:33 +08:00
|
|
|
|
|
|
|
import Livebook.HubHelpers
|
2023-05-17 00:21:49 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
setup_all do
|
|
|
|
case TeamsServer.start() do
|
|
|
|
{:ok, _} -> :ok
|
|
|
|
{:error, {:already_started, _}} -> :ok
|
|
|
|
end
|
|
|
|
|
|
|
|
token = TeamsServer.token()
|
|
|
|
url = TeamsServer.url()
|
|
|
|
user = TeamsServer.user()
|
|
|
|
node = TeamsServer.get_node()
|
|
|
|
|
|
|
|
Application.put_env(:livebook, :teams_url, url, persistent: true)
|
|
|
|
|
|
|
|
{:ok, node: node, token: token, user: user}
|
|
|
|
end
|
|
|
|
end
|