Skip to content

Commit

Permalink
FIXME: BIC tests
Browse files Browse the repository at this point in the history
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
  • Loading branch information
mtrmac committed Jul 30, 2024
1 parent 9463b2e commit 9d1e0c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions pkg/blobinfocache/internal/test/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,9 @@ func assertCandidatesMatch2(t *testing.T, scopeName string, expected []candidate
Digest: ev.d,
CompressionOperation: op,
CompressionAlgorithm: algo,
UnknownLocation: false,
Location: types.BICLocationReference{Opaque: scopeName + ev.lr},
// FIXME: CompressionAnnotations are probably going to be necessary.
UnknownLocation: false,
Location: types.BICLocationReference{Opaque: scopeName + ev.lr},
}
}
assertCandidatesMatch2Native(t, e, actual)
Expand Down Expand Up @@ -513,6 +514,8 @@ func testGenericCandidateLocations2(t *testing.T, cache blobinfocache.BlobInfoCa

// Tests of candidate filtering
// ----------------------------
// FIXME: Set chunked correctly, incl. annotations
// FIXME: Test expected annotations.
for _, e := range digestNameSetFiltering {
cache.RecordKnownLocation(transport, scope, e.d, types.BICLocationReference{Opaque: scopeName + e.n})
}
Expand Down Expand Up @@ -553,6 +556,7 @@ func testGenericCandidateLocations2(t *testing.T, cache blobinfocache.BlobInfoCa
}, res)

// Compression algorithm filters
// FIXME: Test zstd / chunked relationship and uses
res = cache.CandidateLocations2(transport, scope, digestFilteringUncompressed, blobinfocache.CandidateLocations2Options{
CanSubstitute: true,
RequiredCompression: &compression.Gzip,
Expand Down
3 changes: 2 additions & 1 deletion pkg/blobinfocache/sqlite/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ func transaction[T any](sqc *cache, fn func(tx *sql.Tx) (T, error)) (T, error) {
return db, func() { db.Close() }, nil
}()
if err != nil {
var zeroRes T // A zero value of T
logrus.Errorf("SQL error %v", err) // FIXME: DROP?
var zeroRes T // A zero value of T
return zeroRes, err
}
defer closeDB()
Expand Down

0 comments on commit 9d1e0c0

Please sign in to comment.