(t *testing.T)
| 199 | } |
| 200 | |
| 201 | func TestStreamSkipRemovedBlobs(t *testing.T) { |
| 202 | ctx := context.Background() |
| 203 | // Note: This is the only streaming test that makes use of the |
| 204 | // index (for RemoveBlobs() to succeed). The others do create |
| 205 | // an indexed storage but they do not use the index to stream |
| 206 | // (nor should they use it). The streaming in this test is |
| 207 | // done by reading the underlying diskpacks. |
| 208 | s := newTempDiskpacked(t) |
| 209 | |
| 210 | uploadTestBlobs(t, s, testPack1) |
| 211 | |
| 212 | ref, ok := blob.Parse(testPack1[0].digest) |
| 213 | if !ok { |
| 214 | t.Fatalf("blob.Parse: %s", testPack1[0].digest) |
| 215 | } |
| 216 | |
| 217 | err := s.RemoveBlobs(ctx, []blob.Ref{ref}) |
| 218 | if err != nil { |
| 219 | t.Fatalf("RemoveBlobs: %v", err) |
| 220 | } |
| 221 | |
| 222 | diskpackedSto := s.(*storage) |
| 223 | expected := len(testPack1) - 1 // We've deleted 1 |
| 224 | storagetest.TestStreamer(t, diskpackedSto, storagetest.WantN(expected)) |
| 225 | } |
nothing calls this directly
no test coverage detected