mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-12-17 21:50:25 +08:00
Fix test failing because of concurrent compilation (#3031)
This commit is contained in:
parent
3abb44e8f3
commit
9a4fcc8f7d
2 changed files with 15 additions and 8 deletions
|
|
@ -32,15 +32,8 @@ config :livebook,
|
||||||
check_completion_data_interval: 300,
|
check_completion_data_interval: 300,
|
||||||
iframe_port: 4003
|
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,
|
config :livebook,
|
||||||
data_path: data_path,
|
data_path: Path.expand("tmp/livebook_data/test"),
|
||||||
agent_name: "chonky-cat",
|
agent_name: "chonky-cat",
|
||||||
k8s_kubeconfig_pipeline:
|
k8s_kubeconfig_pipeline:
|
||||||
{Kubereq.Kubeconfig.Stub,
|
{Kubereq.Kubeconfig.Stub,
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ defmodule Livebook.Application do
|
||||||
require Logger
|
require Logger
|
||||||
|
|
||||||
def start(_type, _args) do
|
def start(_type, _args) do
|
||||||
|
setup_tests()
|
||||||
|
|
||||||
Logger.add_handlers(:livebook)
|
Logger.add_handlers(:livebook)
|
||||||
Livebook.ZTA.init()
|
Livebook.ZTA.init()
|
||||||
create_teams_hub = parse_teams_hub()
|
create_teams_hub = parse_teams_hub()
|
||||||
|
|
@ -432,4 +434,16 @@ defmodule Livebook.Application do
|
||||||
defp serverless?() do
|
defp serverless?() do
|
||||||
Application.get_env(:livebook, :serverless, false)
|
Application.get_env(:livebook, :serverless, false)
|
||||||
end
|
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
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue