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

Function testConfig

internal/server/server_test.go:1051–1098  ·  view source on GitHub ↗
(timeoutMS int, fallbackEnabled bool)

Source from the content-addressed store, hash-verified

1049}
1050
1051func testConfig(timeoutMS int, fallbackEnabled bool) *config.Config {
1052 return &config.Config{
1053 Server: config.ServerConfig{
1054 Host: "127.0.0.1",
1055 Port: 0,
1056 RequestTimeoutMS: 3000,
1057 },
1058 Telemetry: config.TelemetryConfig{
1059 MetricsEnabled: true,
1060 TracingEnabled: true,
1061 Exporter: "log",
1062 },
1063 Backends: []config.BackendConfig{
1064 {
1065 Name: "small-model",
1066 Type: "mock",
1067 TimeoutMS: timeoutMS,
1068 Cost: config.CostConfig{Unit: 1},
1069 Capabilities: []string{
1070 "chat",
1071 "summarization",
1072 },
1073 },
1074 },
1075 Tenants: []config.TenantConfig{
1076 {
1077 ID: "team-a",
1078 Class: "premium",
1079 Priority: "high",
1080 BudgetPerRequest: 100,
1081 RateLimitRPS: 100,
1082 },
1083 },
1084 Routing: config.RoutingConfig{
1085 DefaultBackend: "small-model",
1086 },
1087 Reliability: config.ReliabilityConfig{
1088 FallbackEnabled: fallbackEnabled,
1089 FallbackRules: []config.FallbackRule{
1090 {
1091 FromBackend: "small-model",
1092 On: []string{"timeout"},
1093 FallbackTo: "small-model",
1094 },
1095 },
1096 },
1097 }
1098}
1099
1100type captureTelemetryExporter struct {
1101 mu sync.Mutex

Calls

no outgoing calls

Tested by

no test coverage detected