Close closes testing environment.
(ctx context.Context, tb testing.TB)
| 139 | |
| 140 | // Close closes testing environment. |
| 141 | func (e *Environment) Close(ctx context.Context, tb testing.TB) { |
| 142 | tb.Helper() |
| 143 | |
| 144 | err := e.RepositoryWriter.Close(ctx) |
| 145 | require.NoError(tb, err, "unable to close") |
| 146 | |
| 147 | if e.connected { |
| 148 | err := repo.Disconnect(ctx, e.ConfigFile()) |
| 149 | require.NoError(tb, err, "error disconnecting") |
| 150 | } |
| 151 | |
| 152 | err = os.Remove(e.configDir) |
| 153 | // should be empty, assuming Disconnect was successful |
| 154 | require.NoError(tb, err, "error removing config directory") |
| 155 | } |
| 156 | |
| 157 | // ConfigFile returns the name of the config file. |
| 158 | func (e *Environment) ConfigFile() string { |
no test coverage detected