Stabilize preview and sandbox cleanup
This commit is contained in:
@@ -36,6 +36,7 @@ defmodule BDS.Scripting.ApiTest do
|
||||
setup do
|
||||
:ok = Ecto.Adapters.SQL.Sandbox.checkout(BDS.Repo)
|
||||
Ecto.Adapters.SQL.Sandbox.mode(BDS.Repo, {:shared, self()})
|
||||
on_exit(fn -> Ecto.Adapters.SQL.Sandbox.mode(BDS.Repo, :manual) end)
|
||||
|
||||
temp_dir =
|
||||
Path.join(System.tmp_dir!(), "bds-scripting-api-#{System.unique_integer([:positive])}")
|
||||
@@ -45,6 +46,10 @@ defmodule BDS.Scripting.ApiTest do
|
||||
|
||||
{:ok, project} = BDS.Projects.create_project(%{name: "Scripting API", data_path: temp_dir})
|
||||
|
||||
on_exit(fn ->
|
||||
_ = BDS.Preview.stop_preview(project.id)
|
||||
end)
|
||||
|
||||
%{project: project}
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user