func (e *Environment) MustConnectOpenAnother(tb testing.TB, openOpts ...func(*repo.Options)) repo.Repository {
	tb.Helper()

	ctx := testlogging.Context(tb)

	config := filepath.Join(testutil.TempDirectory(tb), "kopia.config")
	connOpts := &repo.ConnectOptions{
		CachingOptions: content.CachingOptions{
			CacheDirectory: testutil.TempDirectory(tb),
		},
	}

	if err := repo.Connect(ctx, config, e.st, e.Password, connOpts); err != nil {
		tb.Fatal("can't connect:", err)
	}

	rep, err := repo.Open(ctx, e.ConfigFile(), e.Password, repoOptions(openOpts))
	if err != nil {
		tb.Fatal("can't open:", err)
	}

	return rep
}
// MustConnectOpenAnother opens another repository backed by the same storage,
// with independent config and cache options.
MustConnectOpenAnother opens another repository backed by the same storage,
with independent config and cache options.
// MustConnectOpenAnother opens another repository backed by the same storage // with independent config and cache options .
func (e *Environment) MustConnectOpenAnother(tb testing.TB, openOpts ...func(*repo.Options)) repo.Repository {
	tb.Helper()
	ctx := testlogging.Context(tb)
	config := filepath.Join(testutil.TempDirectory(tb), "kopia.config")
	connOpts := &repo.ConnectOptions{
		CachingOptions: content.CachingOptions{
			CacheDirectory: testutil.TempDirectory(tb),
		},
	}
	if err := repo.Connect(ctx, config, e.st, e.Password, connOpts); err != nil {
		tb.Fatal("can't connect:", err)
	}
	rep, err := repo.Open(ctx, e.ConfigFile(), e.Password, repoOptions(openOpts))
	if err != nil {
		tb.Fatal("can't open:", err)
	}
	return rep
}
func ( e * Environment ) MustConnectOpenAnother ( tb testing . TB , openOpts ... func ( * repo . Options ) ) repo . Repository { tb . Helper ( ) ctx := testlogging . Context ( tb ) config := filepath . Join ( testutil . TempDirectory ( tb ) , " " ) connOpts := & repo . ConnectOptions { CachingOptions : content . CachingOptions { CacheDirectory : testutil . TempDirectory ( tb ) , } , } if err := repo . Connect ( ctx , config , e . st , e . Password , connOpts ) ; err != nil { tb . Fatal ( " " , err ) } rep , err := repo . Open ( ctx , e . ConfigFile ( ) , e . Password , repoOptions ( openOpts ) ) if err != nil { tb . Fatal ( " " , err ) } return rep }
MustConnectOpenAnother opens another repository backed by the same storage,
with independent config and cache options.
MustConnectOpenAnother opens another repository backed by the same storage with independent config and cache options .