| 229 | } |
| 230 | |
| 231 | func TempDir(ctx context.Context) (context.Context, string) { |
| 232 | utl := &testUtil{} |
| 233 | |
| 234 | var err error |
| 235 | ctx, err = SetupState[testUtil](ctx, &utl) |
| 236 | if err != nil { |
| 237 | panic(err) |
| 238 | } |
| 239 | |
| 240 | if utl.tempDir == "" { |
| 241 | t := Testing(ctx) |
| 242 | utl.tempDir = t.TempDir() |
| 243 | } |
| 244 | |
| 245 | return ctx, utl.tempDir |
| 246 | } |
| 247 | |
| 248 | // TestContainersRequest modifies the req to keep the container running after the test if PersistStubEnvironment is set to true in the ctx |
| 249 | func TestContainersRequest(ctx context.Context, req testcontainers.ContainerRequest) testcontainers.ContainerRequest { |