That’s exactly correct. There’s a bunch of handy features here. For example to support your test code:
def start_link(opts) do
if Application.get_env(:my_app, :start_populator) do
GenServer.start_link(__MODULE__, opts, [])
else
:ignore
end
end
If start_populator is false (in your test.exs for example) then it just ignores it and doesn’t try to start it in the supervision tree. This lets you test error or success cases in your test cases themselves without causing issues with application start.






















