Skip to content

Commit

Permalink
Add engine acceptance tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalloc committed May 25, 2023
1 parent c38af43 commit 39595e8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc.go
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// Package verity is an event-sourcing Dogma engine.
package verity
19 changes: 19 additions & 0 deletions engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ package verity_test

import (
"context"
"testing"
"time"

"github.com/dogmatiq/dogma"
. "github.com/dogmatiq/dogma/fixtures"
"github.com/dogmatiq/enginekit/enginetest"
. "github.com/dogmatiq/verity"
. "github.com/dogmatiq/verity/fixtures"
"github.com/dogmatiq/verity/persistence/memorypersistence"
Expand All @@ -15,6 +17,23 @@ import (

var _ dogma.CommandExecutor = (*Engine)(nil)

func TestEngine(t *testing.T) {
enginetest.RunTests(
t,
func(p enginetest.SetupParams) enginetest.SetupResult {
e := New(
p.App,
WithPersistence(&memorypersistence.Provider{}),
)

return enginetest.SetupResult{
RunEngine: e.Run,
Executor: e,
}
},
)
}

var _ = Describe("type Engine", func() {
var (
app *Application
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require (
github.com/dogmatiq/discoverkit v0.1.2
github.com/dogmatiq/dodeca v1.4.2
github.com/dogmatiq/dogma v0.12.0
github.com/dogmatiq/enginekit v0.0.0-20230525024931-1b66076de481
github.com/dogmatiq/iago v0.4.0
github.com/dogmatiq/interopspec v0.5.2
github.com/dogmatiq/kyu v0.2.0
Expand All @@ -28,6 +29,8 @@ require (
google.golang.org/protobuf v1.30.0
)

replace github.com/dogmatiq/testkit => ../testkit

require (
github.com/fxamacker/cbor/v2 v2.4.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ github.com/dogmatiq/dodeca v1.4.2 h1:qVQpMfFju99fvAcV3h1lA0yVaD5X38EpO1my0iKpTqs
github.com/dogmatiq/dodeca v1.4.2/go.mod h1:kYImsyZhGxSOLiqzTK4Z1CB9ycSLpnJPBQa2yR//N5Q=
github.com/dogmatiq/dogma v0.12.0 h1:hUvAbdrcLGAP2IrpBKvdbUSGubgNKzqa5QfFarIQPfU=
github.com/dogmatiq/dogma v0.12.0/go.mod h1:op4IjAGC593ONvvUPhh2xNyk/3Ezv9HkCPRlzdbkX9Y=
github.com/dogmatiq/enginekit v0.0.0-20230525024931-1b66076de481 h1:pOv5GHaJiSw1wfdvijBvjr50omRzM0gkLIuCyQdYjkY=
github.com/dogmatiq/enginekit v0.0.0-20230525024931-1b66076de481/go.mod h1:Q52R9MTBkX/3fm6SSfJkagdDYCnyujRNTOs0+1FiC9E=
github.com/dogmatiq/iago v0.4.0 h1:57nZqVT34IZxtCZEW/RFif7DNUEjMXgevfr/Mmd0N8I=
github.com/dogmatiq/iago v0.4.0/go.mod h1:fishMWBtzYcjgis6d873VTv9kFm/wHYLOzOyO9ECBDc=
github.com/dogmatiq/interopspec v0.5.2 h1:opcn/hxV128Lgo+1rBJY8TsIdpagwXNOawx/UTx9e08=
Expand Down

0 comments on commit 39595e8

Please sign in to comment.