Files
buildkit/solver/bboltcachestorage/storage_test.go
Tonis Tiigi 13bd25cd58 db: move DB dependencies to transactor interface
This allows more flexible control over DB transactions
and compaction.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-07-25 12:55:16 -07:00

25 lines
481 B
Go

package bboltcachestorage
import (
"path/filepath"
"testing"
"github.com/moby/buildkit/solver"
"github.com/moby/buildkit/solver/testutil"
"github.com/stretchr/testify/require"
)
func TestBoltCacheStorage(t *testing.T) {
testutil.RunCacheStorageTests(t, func() solver.CacheKeyStorage {
tmpDir := t.TempDir()
st, err := NewStore(filepath.Join(tmpDir, "cache.db"))
require.NoError(t, err)
t.Cleanup(func() {
require.NoError(t, st.Close())
})
return st
})
}