MCPcopy
hub / github.com/containerd/containerd / runMigrationTest

Function runMigrationTest

core/metadata/db_test.go:402–418  ·  view source on GitHub ↗
(i int, init, check func(*bolt.Tx) error)

Source from the content-addressed store, hash-verified

400}
401
402func runMigrationTest(i int, init, check func(*bolt.Tx) error) func(t *testing.T) {
403 return func(t *testing.T) {
404 _, db := testEnv(t)
405
406 if err := db.Update(init); err != nil {
407 t.Fatal(err)
408 }
409
410 if err := db.Update(migrations[i].migrate); err != nil {
411 t.Fatal(err)
412 }
413
414 if err := db.View(check); err != nil {
415 t.Fatal(err)
416 }
417 }
418}
419
420func readDBVersion(db *bolt.DB, schema []byte) (int, error) {
421 var version int

Callers 1

TestMigrationsFunction · 0.85

Calls 4

FatalMethod · 0.80
testEnvFunction · 0.70
UpdateMethod · 0.65
ViewMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…