MCPcopy
hub / github.com/kopia/kopia / NewEnvironment

Function NewEnvironment

internal/repotesting/repotesting.go:265–279  ·  view source on GitHub ↗

NewEnvironment creates a new repository testing environment and ensures its cleanup at the end of the test.

(tb testing.TB, version format.Version, opts ...Options)

Source from the content-addressed store, hash-verified

263
264// NewEnvironment creates a new repository testing environment and ensures its cleanup at the end of the test.
265func NewEnvironment(tb testing.TB, version format.Version, opts ...Options) (context.Context, *Environment) {
266 tb.Helper()
267
268 ctx := testlogging.Context(tb)
269
270 var env Environment
271
272 env.setup(tb, version, opts...)
273
274 tb.Cleanup(func() {
275 env.Close(ctx, tb)
276 })
277
278 return ctx, &env
279}

Calls 5

setupMethod · 0.95
CloseMethod · 0.95
ContextFunction · 0.92
HelperMethod · 0.80
CleanupMethod · 0.65