MustOpenAnother opens another repository backed by the same storage location.
(tb testing.TB, openOpts ...func(*repo.Options))
| 183 | |
| 184 | // MustOpenAnother opens another repository backed by the same storage location. |
| 185 | func (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. |