Persisted returns true if the test environment persists after the test has finished
(ctx context.Context)
| 87 | |
| 88 | // Persisted returns true if the test environment persists after the test has finished |
| 89 | func Persisted(ctx context.Context) bool { |
| 90 | persist, ok := ctx.Value(PersistStubEnvironment).(bool) |
| 91 | |
| 92 | // if we're either not persisting or we ran in restored environment, this is |
| 93 | // to allow the environment to persist and not require both -persist and -restore |
| 94 | // to be specified, i.e. when running with -restore, -persist is assumed |
| 95 | return ok && persist || Restored(ctx) |
| 96 | } |
| 97 | |
| 98 | // Restored returns true if the test environment is restored from the last persisted environment |
| 99 | func Restored(ctx context.Context) bool { |