MCPcopy
hub / github.com/containerd/containerd / testEnv

Function testEnv

core/metadata/containers_test.go:709–723  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

707}
708
709func testEnv(t *testing.T) (context.Context, *bolt.DB) {
710 ctx := t.Context()
711 ctx = namespaces.WithNamespace(ctx, "testing")
712 ctx = logtest.WithT(ctx, t)
713 dirname := t.TempDir()
714
715 db, err := bolt.Open(filepath.Join(dirname, "meta.db"), 0644, nil)
716 require.NoError(t, err)
717
718 t.Cleanup(func() {
719 assert.NoError(t, db.Close())
720 })
721
722 return ctx, db
723}

Callers 9

TestLeasesFunction · 0.70
TestLeasesListFunction · 0.70
TestLeaseResourceFunction · 0.70
TestContainersListFunction · 0.70
TestImagesListFunction · 0.70
TestInitFunction · 0.70
runMigrationTestFunction · 0.70

Calls 5

WithNamespaceFunction · 0.92
CleanupMethod · 0.65
CloseMethod · 0.65
ContextMethod · 0.45
OpenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…