forked from commanded/commanded-eventstore-adapter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa9375b
commit 7f826f3
Showing
13 changed files
with
160 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[ | ||
inputs: [ | ||
"lib/*/{lib,test}/**/*.{ex,exs}", | ||
"lib/*/mix.exs" | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
language: elixir | ||
|
||
elixir: | ||
- 1.5.2 | ||
- 1.7.3 | ||
|
||
otp_release: | ||
- 20.1 | ||
- 21.0 | ||
|
||
services: | ||
- postgresql | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
use Mix.Config | ||
|
||
config :commanded, | ||
event_store_adapter: Commanded.EventStore.Adapters.EventStore | ||
config :commanded, event_store_adapter: Commanded.EventStore.Adapters.EventStore | ||
|
||
import_config "#{Mix.env}.exs" | ||
import_config "#{Mix.env()}.exs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
defmodule Commanded.EventStore.Adapters.EventStore.AppendEventsTest do | ||
use Commanded.EventStore.AppendEventsTestCase | ||
|
||
alias Commanded.EventStore.Adapters.EventStore.Storage | ||
|
||
setup_all do | ||
{:ok, conn} = Storage.connect() | ||
|
||
[conn: conn] | ||
end | ||
|
||
setup %{conn: conn} do | ||
on_exit(fn -> | ||
Storage.reset!(conn) | ||
end) | ||
|
||
:ok | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
defmodule Commanded.EventStore.Adapters.EventStore.SnapshotTest do | ||
use Commanded.EventStore.SnapshotTestCase | ||
|
||
alias Commanded.EventStore.Adapters.EventStore.Storage | ||
|
||
setup_all do | ||
{:ok, conn} = Storage.connect() | ||
|
||
[conn: conn] | ||
end | ||
|
||
setup %{conn: conn} do | ||
on_exit(fn -> | ||
Storage.reset!(conn) | ||
end) | ||
|
||
:ok | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
defmodule Commanded.EventStore.Adapters.EventStore.SubscriptionTest do | ||
use Commanded.EventStore.SubscriptionTestCase | ||
|
||
alias Commanded.EventStore.Adapters.EventStore.Storage | ||
|
||
setup_all do | ||
{:ok, conn} = Storage.connect() | ||
|
||
[conn: conn] | ||
end | ||
|
||
setup %{conn: conn} do | ||
on_exit(fn -> | ||
Storage.reset!(conn) | ||
end) | ||
|
||
:ok | ||
end | ||
|
||
defp event_store_wait(_default \\ nil), do: 100 | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
defmodule Commanded.EventStore.Adapters.EventStore.Storage do | ||
def connect do | ||
postgrex_config = EventStore.Config.parsed() |> EventStore.Config.default_postgrex_opts() | ||
|
||
Postgrex.start_link(postgrex_config) | ||
end | ||
|
||
def reset!(conn) do | ||
Application.stop(:eventstore) | ||
|
||
EventStore.Storage.Initializer.reset!(conn) | ||
|
||
Application.ensure_all_started(:eventstore) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1 @@ | ||
ExUnit.start() | ||
|
||
Mix.Task.run("event_store.create", ~w(--quiet)) | ||
|
||
# Configure this event store adapter for Commanded | ||
Application.put_env(:commanded, :event_store_adapter, Commanded.EventStore.Adapters.EventStore) | ||
|
||
postgrex_config = EventStore.Config.parsed() |> EventStore.Config.default_postgrex_opts() | ||
|
||
{:ok, conn} = Postgrex.start_link(postgrex_config) | ||
|
||
Application.put_env(:commanded, :stop_storage, fn -> | ||
Application.stop(:eventstore) | ||
end) | ||
|
||
Application.put_env(:commanded, :reset_storage, fn -> | ||
EventStore.Storage.Initializer.reset!(conn) | ||
|
||
Application.ensure_all_started(:eventstore) | ||
|
||
:ok | ||
end) |