Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,8 @@ config :livebook,
check_completion_data_interval: 300,
iframe_port: 4003

data_path = Path.expand("tmp/livebook_data/test")

# Clear data path for tests
if File.exists?(data_path) do
File.rm_rf!(data_path)
end

config :livebook,
data_path: data_path,
data_path: Path.expand("tmp/livebook_data/test"),
agent_name: "chonky-cat",
k8s_kubeconfig_pipeline:
{Kubereq.Kubeconfig.Stub,
Expand Down
14 changes: 14 additions & 0 deletions lib/livebook/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ defmodule Livebook.Application do
require Logger

def start(_type, _args) do
setup_tests()

Logger.add_handlers(:livebook)
Livebook.ZTA.init()
create_teams_hub = parse_teams_hub()
Expand Down Expand Up @@ -432,4 +434,16 @@ defmodule Livebook.Application do
defp serverless?() do
Application.get_env(:livebook, :serverless, false)
end

if Mix.env() == :test do
defp setup_tests() do
data_path = Livebook.Config.data_path()
# Clear data path for tests
if File.exists?(data_path) do
File.rm_rf!(data_path)
end
end
else
defp setup_tets(), do: :ok
end
end