(t *testing.T)
| 163 | } |
| 164 | |
| 165 | func 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: |
nothing calls this directly
no test coverage detected