Open jarlah opened 7 hours ago
Or is it possible ? Specify repo param to postgres_container in ecto module? Is EventStore a Repo .... EDIT: nope:
@impl true
def start(_type, _args) do
if Application.get_env(:testcontainers, :enabled, false) do
{:ok, _} = Testcontainers.Ecto.postgres_container(app: :journi_plan, repo: JourniPlan.Repo)
{:ok, _} = Testcontainers.Ecto.postgres_container(app: :journi_plan, repo: JourniPlan.EventStore) |> IO.inspect(label: "EventStore")
end
** (MatchError) no match of right hand side value: {:error, %UndefinedFunctionError{module: JourniPlan.EventStore, function: :__adapter__, arity: 0, reason: nil, message: nil}}
%UndefinedFunctionError{module: JourniPlan.EventStore, function: :__adapter__, arity: 0, reason: nil, message: nil}
actually its severely limited ... and i dont have any good example tests for usage in "normal unit tests"
muahaha. Got it working. But will need to think about how to make it a usable thing in testcontainers ;)
When using Commanded we quickly realize that this library is not meant for anything but one repo.
need to look into how we can support multiple repos/configs.