feat: runtime manager

This commit is contained in:
Ilia Denisov
2026-04-28 20:39:18 +02:00
committed by GitHub
parent e0a99b346b
commit a7cee15115
289 changed files with 45660 additions and 2207 deletions
+11 -11
View File
@@ -12,9 +12,9 @@ import (
"testing"
"time"
"galaxy/lobby/internal/adapters/gamestub"
"galaxy/lobby/internal/adapters/gameturnstatsstub"
"galaxy/lobby/internal/adapters/streamoffsetstub"
"galaxy/lobby/internal/adapters/gameinmem"
"galaxy/lobby/internal/adapters/gameturnstatsinmem"
"galaxy/lobby/internal/adapters/streamoffsetinmem"
"galaxy/lobby/internal/domain/common"
"galaxy/lobby/internal/domain/game"
"galaxy/lobby/internal/ports"
@@ -60,10 +60,10 @@ func (e *fakeEvaluator) SetError(err error) {
}
type harness struct {
games *gamestub.Store
stats *gameturnstatsstub.Store
games *gameinmem.Store
stats *gameturnstatsinmem.Store
evaluator *fakeEvaluator
offsets *streamoffsetstub.Store
offsets *streamoffsetinmem.Store
consumer *gmevents.Consumer
server *miniredis.Miniredis
clientRedis *redis.Client
@@ -78,10 +78,10 @@ func newHarness(t *testing.T) *harness {
clientRedis := redis.NewClient(&redis.Options{Addr: server.Addr()})
t.Cleanup(func() { _ = clientRedis.Close() })
games := gamestub.NewStore()
stats := gameturnstatsstub.NewStore()
games := gameinmem.NewStore()
stats := gameturnstatsinmem.NewStore()
evaluator := &fakeEvaluator{}
offsets := streamoffsetstub.NewStore()
offsets := streamoffsetinmem.NewStore()
at := time.Date(2026, 4, 25, 14, 0, 0, 0, time.UTC)
now := at.Add(-2 * time.Hour)
@@ -207,8 +207,8 @@ func TestNewConsumerRejectsMissingDeps(t *testing.T) {
Client: client,
Stream: "gm:lobby_events",
BlockTimeout: time.Second,
Games: gamestub.NewStore(),
Stats: gameturnstatsstub.NewStore(),
Games: gameinmem.NewStore(),
Stats: gameturnstatsinmem.NewStore(),
})
require.Error(t, err, "missing capability evaluator")
}