MCPcopy Create free account
hub / github.com/InferCore/InferCore / TestReplayExact_MissingPrimaryBackend

Function TestReplayExact_MissingPrimaryBackend

internal/replay/replay_test.go:52–75  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

50}
51
52func TestReplayExact_MissingPrimaryBackend(t *testing.T) {
53 st := requests.NewMemoryStore()
54 req := types.AIRequest{
55 TenantID: "t",
56 TaskType: "chat",
57 Priority: "p",
58 Input: map[string]any{"text": "hi"},
59 Options: types.RequestOptions{Stream: false, MaxTokens: 64},
60 }
61 full, _ := json.Marshal(req)
62 _ = st.CreateRequest(context.Background(), requests.RequestRow{
63 RequestID: "rid2",
64 TenantID: "t",
65 TaskType: "chat",
66 Priority: "p",
67 AIRequestJSON: full,
68 CreatedAt: time.Now(),
69 UpdatedAt: time.Now(),
70 })
71 _, err := Replay(context.Background(), &config.Config{}, st, "rid2", ModeExact, Dependencies{})
72 if err == nil || !strings.Contains(err.Error(), "missing primary backend") {
73 t.Fatalf("err=%v", err)
74 }
75}
76
77func replayTestConfig() *config.Config {
78 return &config.Config{

Callers

nothing calls this directly

Calls 4

NewMemoryStoreFunction · 0.92
ReplayFunction · 0.85
CreateRequestMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected