Commit 5031d58
committed
feat: add ContainerGuard for RAII container lifecycle management
Implements #216. ContainerGuard provides automatic container lifecycle
management for tests using the RAII pattern:
- Builder pattern for configuration (remove_on_drop, stop_on_drop,
keep_on_panic, capture_logs, reuse_if_running)
- Automatic cleanup on drop (stop and/or remove containers)
- Dynamic port mapping via host_port()
- Log capture on test failures with keep_on_panic
- Container reuse support for faster test iterations
- Works with any Template implementation
New testing feature flag enables the module. Requires template-redis
as a dependency for the Template trait.1 parent f0a68af commit 5031d58
4 files changed
Lines changed: 605 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| 405 | + | |
405 | 406 | | |
406 | 407 | | |
407 | 408 | | |
| |||
464 | 465 | | |
465 | 466 | | |
466 | 467 | | |
| 468 | + | |
| 469 | + | |
467 | 470 | | |
468 | 471 | | |
469 | 472 | | |
| |||
0 commit comments