Fix test failing because of concurrent compilation (#3031)

This commit is contained in:
Jonatan Kłosko 2025-07-12 12:57:51 +02:00 committed by GitHub
parent 3abb44e8f3
commit 9a4fcc8f7d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 8 deletions

View file

@ -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,

View file

@ -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()
@ -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