Skip to content

Commit 0147a44

Browse files
committed
test(sqlite): ensure tolerant bundle removal
Signed-off-by: Nick Hale <[email protected]>
1 parent de74420 commit 0147a44

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pkg/sqlite/load_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,18 @@ func newBundle(t *testing.T, name, pkgName string, channels []string, objs ...*u
252252
return bundle
253253
}
254254

255+
func TestRMBundle(t *testing.T) {
256+
db, cleanup := CreateTestDb(t)
257+
defer cleanup()
258+
store, err := NewSQLLiteLoader(db)
259+
require.NoError(t, err)
260+
require.NoError(t, store.Migrate(context.Background()))
261+
tx, err := db.Begin()
262+
require.NoError(t, err)
263+
loader := store.(*sqlLoader)
264+
require.NoError(t, loader.rmBundle(tx, "non-existent"))
265+
}
266+
255267
func TestGetTailFromBundle(t *testing.T) {
256268
type fields struct {
257269
bundles []*registry.Bundle

0 commit comments

Comments
 (0)