MCPcopy
hub / github.com/grafana/tempo / TestInitLiveStoreSingleBinaryUsesLocalIngest

Function TestInitLiveStoreSingleBinaryUsesLocalIngest

cmd/tempo/app/modules_test.go:186–215  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

184}
185
186func TestInitLiveStoreSingleBinaryUsesLocalIngest(t *testing.T) {
187 cfg := NewDefaultConfig()
188 cfg.Target = SingleBinary
189 cfg.LiveStore.WAL.Filepath = t.TempDir()
190 cfg.LiveStore.ShutdownMarkerDir = t.TempDir()
191 cfg.LiveStore.Ring.InstanceID = "single-binary"
192
193 partitionRingStore, partitionRingCloser := consul.NewInMemoryClient(dskitring.GetPartitionRingCodec(), log.NewNopLogger(), nil)
194 defer partitionRingCloser.Close()
195 readRingStore, readRingCloser := consul.NewInMemoryClient(dskitring.GetCodec(), log.NewNopLogger(), nil)
196 defer readRingCloser.Close()
197 cfg.LiveStore.PartitionRing.KVStore.Mock = partitionRingStore
198 cfg.LiveStore.Ring.KVStore.Mock = readRingStore
199
200 overridesSvc, err := overrides.NewOverrides(cfg.Overrides, nil, prometheus.NewRegistry())
201 require.NoError(t, err)
202
203 app := &App{
204 cfg: *cfg,
205 Server: &fakeTempoServer{router: mux.NewRouter(), grpc: grpc.NewServer()},
206 Overrides: overridesSvc,
207 store: newTestStore(t, t.TempDir()),
208 }
209
210 svc, err := app.initLiveStore()
211 require.NoError(t, err)
212 require.NotNil(t, svc)
213 require.NotNil(t, app.liveStore)
214 assert.False(t, app.cfg.LiveStore.ConsumeFromKafka)
215}
216
217func TestSetupModuleManagerSingleBinaryUsesLocalDistributorAndGeneratorDeps(t *testing.T) {
218 cfg := NewDefaultConfig()

Callers

nothing calls this directly

Calls 5

initLiveStoreMethod · 0.95
NewOverridesFunction · 0.92
NewDefaultConfigFunction · 0.85
newTestStoreFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected