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

Function TestTenantDeletion

integration/storage/poller_test.go:165–286  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

163}
164
165func TestTenantDeletion(t *testing.T) {
166 storageBackendTestPermutations := []struct {
167 name string
168 prefix string
169 }{
170 {
171 name: "empty-string-prefix",
172 prefix: "",
173 },
174 {
175 name: "no-prefix",
176 },
177 {
178 name: "prefix",
179 prefix: "a/b/c/",
180 },
181 {
182 name: "prefix-no-trailing-slash",
183 prefix: "a/b/c",
184 },
185 }
186
187 logger := log.NewLogfmtLogger(os.Stdout)
188
189 for _, pc := range storageBackendTestPermutations {
190 t.Run(pc.name, func(t *testing.T) {
191 util.RunIntegrationTests(t, util.TestHarnessConfig{
192 DeploymentMode: util.DeploymentModeNone,
193 Backends: util.BackendObjectStorageAll,
194 }, func(h *util.TempoHarness) {
195 // Get the config to determine backend type and settings
196 cfg, err := h.GetConfig()
197 require.NoError(t, err)
198
199 var rr backend.RawReader
200 var ww backend.RawWriter
201 var cc backend.Compactor
202
203 listBlockConcurrency := 3
204 ctx, cancel := context.WithCancel(context.Background())
205 defer cancel()
206
207 // Get backend endpoint from the harness
208 objStorage := h.Services[util.ServiceObjectStorage]
209 e := objStorage.Endpoint(objStorage.HTTPPort())
210
211 switch cfg.StorageConfig.Trace.Backend {
212 case backend.S3:
213 cfg.StorageConfig.Trace.S3.Endpoint = e
214 cfg.StorageConfig.Trace.S3.ListBlocksConcurrency = listBlockConcurrency
215 cfg.StorageConfig.Trace.S3.Prefix = pc.prefix
216 rr, ww, cc, err = s3.New(cfg.StorageConfig.Trace.S3)
217 case backend.GCS:
218 cfg.StorageConfig.Trace.GCS.Endpoint = e
219 cfg.StorageConfig.Trace.GCS.ListBlocksConcurrency = listBlockConcurrency
220 cfg.StorageConfig.Trace.GCS.Prefix = pc.prefix
221 rr, ww, cc, err = gcs.New(cfg.StorageConfig.Trace.GCS)
222 case backend.Azure:

Callers

nothing calls this directly

Calls 15

DoMethod · 0.95
TenantsMethod · 0.95
RunIntegrationTestsFunction · 0.92
NewFunction · 0.92
NewFunction · 0.92
NewFunction · 0.92
NewReaderFunction · 0.92
NewWriterFunction · 0.92
NewPollerFunction · 0.92
NewFunction · 0.92
writeBadBlockFilesFunction · 0.85
GetConfigMethod · 0.80

Tested by

no test coverage detected