Skip to content

Commit

Permalink
Add engine test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalloc committed Mar 25, 2024
1 parent 9f82f13 commit aa2dafb
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
24 changes: 24 additions & 0 deletions engine/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,44 @@ package engine_test
import (
"context"
"errors"
"testing"
"time"

"github.com/dogmatiq/configkit"
. "github.com/dogmatiq/configkit/fixtures"
"github.com/dogmatiq/configkit/message"
"github.com/dogmatiq/dogma"
. "github.com/dogmatiq/dogma/fixtures"
"github.com/dogmatiq/enginekit/enginetest"
"github.com/dogmatiq/testkit/engine"
. "github.com/dogmatiq/testkit/engine"
"github.com/dogmatiq/testkit/envelope"
"github.com/dogmatiq/testkit/fact"
g "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

func TestEngine(t *testing.T) {
enginetest.RunTests(
t,
func(p enginetest.SetupParams) enginetest.SetupResult {
e, err := New(configkit.FromApplication(p.App))
if err != nil {
t.Fatal(err)
}

return enginetest.SetupResult{
RunEngine: func(ctx context.Context) error {
return Run(ctx, e, 0)
},
Executor: &engine.CommandExecutor{
Engine: e,
},
}
},
)
}

var _ = g.Describe("type Engine", func() {
var (
aggregate *AggregateMessageHandler
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/dogmatiq/cosyne v0.2.0
github.com/dogmatiq/dapper v0.5.1
github.com/dogmatiq/dogma v0.12.1
github.com/dogmatiq/enginekit v0.0.0-20240305232210-250991e0d96a
github.com/dogmatiq/iago v0.4.0
github.com/dogmatiq/linger v1.1.0
github.com/onsi/ginkgo/v2 v2.17.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ github.com/dogmatiq/dapper v0.5.1 h1:ukchNhVD9XUPsdEebJCmCsi1LaTDyouz3HrwoiYUSSU
github.com/dogmatiq/dapper v0.5.1/go.mod h1:GkboktespYmpKgOG70ylT1gmD0LE12NL1YtDnLd1j/E=
github.com/dogmatiq/dogma v0.12.1 h1:mWIzmi3jio9ZnHJeJKNS5D19O2S4x4SLSxGXXn3IQiQ=
github.com/dogmatiq/dogma v0.12.1/go.mod h1:op4IjAGC593ONvvUPhh2xNyk/3Ezv9HkCPRlzdbkX9Y=
github.com/dogmatiq/enginekit v0.0.0-20240305232210-250991e0d96a h1:CZZrqIf63a4BQHwkZHQtmfg4GxogIQ4KsJnVHDjBHuk=
github.com/dogmatiq/enginekit v0.0.0-20240305232210-250991e0d96a/go.mod h1:MrYjDhp8dz6/+dAGlR5T3/1dVX5h2AtdlKu7DIA5sTg=
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/jumble v0.1.0 h1:Cb3ExfxY+AoUP4G9/sOwoOdYX8o+kOLK8+dhXAry+QA=
Expand Down
6 changes: 3 additions & 3 deletions internal/fixtures/protobuf.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit aa2dafb

Please sign in to comment.