MCPcopy
hub / github.com/kopia/kopia / MustOpenAnother

Method MustOpenAnother

internal/repotesting/repotesting.go:185–201  ·  view source on GitHub ↗

MustOpenAnother opens another repository backed by the same storage location.

(tb testing.TB, openOpts ...func(*repo.Options))

Source from the content-addressed store, hash-verified

183
184// MustOpenAnother opens another repository backed by the same storage location.
185func (e *Environment) MustOpenAnother(tb testing.TB, openOpts ...func(*repo.Options)) repo.RepositoryWriter {
186 tb.Helper()
187
188 ctx := testlogging.Context(tb)
189
190 rep2, err := repo.Open(ctx, e.ConfigFile(), e.Password, repoOptions(openOpts))
191 require.NoError(tb, err)
192
193 tb.Cleanup(func() {
194 rep2.Close(ctx)
195 })
196
197 _, w, err := rep2.NewWriter(ctx, repo.WriteSessionOptions{Purpose: "test"})
198 require.NoError(tb, err)
199
200 return w
201}
202
203// MustConnectOpenAnother opens another repository backed by the same storage,
204// with independent config and cache options.

Calls 8

ConfigFileMethod · 0.95
ContextFunction · 0.92
OpenFunction · 0.92
repoOptionsFunction · 0.85
HelperMethod · 0.80
CleanupMethod · 0.65
CloseMethod · 0.65
NewWriterMethod · 0.65