commanded / commanded/commanded
Wiki Testing section is outdated
Nobody has claimed this yet.
- Dominant language
- Elixir
- Stars
- 2k
- Forks
- 258
- PR merge metrics
- No merged PRs in 30d
Description
The EventStore.Storage.Initializer.reset! signature has changed, therefore we now have to do:
config = Conduit.EventStore.config()
{:ok, conn} = Postgrex.start_link(config)
EventStore.Storage.Initializer.reset!(conn, config)
Also I've been unable to get the test setup working with TRUNCATE TABLE for some reason (is the recommended setup perhaps not working with the latest version of Ecto?). However, the Ecto sandbox works perfectly fine, and can be set up in the following way:
defmodule Conduit.DataCase do
use ExUnit.CaseTemplate
using do
...
end
def setup_sandbox() do
pid = Ecto.Adapters.SQL.Sandbox.start_owner!(Conduit.Repo, shared: true)
on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end)
end
def setup_storage() do
{:ok, _} = Application.ensure_all_started(:conduit)
on_exit(fn ->
:ok = Application.stop(:conduit)
Conduit.Storage.reset!()
end)
end
setup tags do
setup_storage()
setup_sandbox()
:ok
end
end
And in config/test.exs:
config :conduit, Conduit.Repo,
...
pool: Ecto.Adapters.SQL.Sandbox
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the Wiki Testing section and compare its EventStore.Storage.Initializer.reset! example with the updated conn/config form in the issue. Review the setup_sandbox and setup_storage examples and config/test.exs, then update the documentation to show the working Ecto sandbox setup and current reset call.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elixir, postgresql
- Domain
- database, documentation, testing
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100