Refactor test runtime ownership
Some checks failed
CI / Test (OTP 27.2 / Elixir 1.18.2) (push) Failing after 0s
CI / Test (OTP 28.4 / Elixir 1.19.4 + Marmot E2E) (push) Failing after 0s

This commit is contained in:
2026-03-17 12:06:32 +01:00
parent 35c8d50db0
commit f4d94c9fcb
37 changed files with 142 additions and 247 deletions

View File

@@ -5,19 +5,6 @@ defmodule Parrhesia.Application do
@impl true
def start(_type, _args) do
children = [
Parrhesia.Telemetry,
Parrhesia.Config,
Parrhesia.Storage.Supervisor,
Parrhesia.Subscriptions.Supervisor,
Parrhesia.Auth.Supervisor,
Parrhesia.Sync.Supervisor,
Parrhesia.Policy.Supervisor,
Parrhesia.Web.Endpoint,
Parrhesia.Tasks.Supervisor
]
opts = [strategy: :one_for_one, name: Parrhesia.Supervisor]
Supervisor.start_link(children, opts)
Parrhesia.Runtime.start_link(name: Parrhesia.Supervisor)
end
end

29
lib/parrhesia/runtime.ex Normal file
View File

@@ -0,0 +1,29 @@
defmodule Parrhesia.Runtime do
@moduledoc false
use Supervisor
def start_link(opts \\ []) do
name = Keyword.get(opts, :name, Parrhesia.Supervisor)
Supervisor.start_link(__MODULE__, opts, name: name)
end
@impl true
def init(_opts) do
Supervisor.init(children(), strategy: :one_for_one)
end
def children do
[
Parrhesia.Telemetry,
Parrhesia.Config,
Parrhesia.Storage.Supervisor,
Parrhesia.Subscriptions.Supervisor,
Parrhesia.Auth.Supervisor,
Parrhesia.Sync.Supervisor,
Parrhesia.Policy.Supervisor,
Parrhesia.Web.Endpoint,
Parrhesia.Tasks.Supervisor
]
end
end