TestContainersRequest modifies the req to keep the container running after the test if PersistStubEnvironment is set to true in the ctx
(ctx context.Context, req testcontainers.ContainerRequest)
| 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 { |
| 250 | persisted := Persisted(ctx) |
| 251 | |
| 252 | req.AutoRemove = !persisted |
| 253 | if persisted { |
| 254 | os.Setenv("TESTCONTAINERS_RYUK_DISABLED", "true") |
| 255 | } |
| 256 | |
| 257 | return req |
| 258 | } |
| 259 | |
| 260 | // CLIVersion returns the version of the CLI, useful for matching in snapshots |
| 261 | func CLIVersion(ctx context.Context) (string, error) { |
no test coverage detected