feat: implement new MultiStrategy design - #580
Conversation
Codecov Report
@@ Coverage Diff @@
## main #580 +/- ##
=========================================
- Coverage 13.54% 6.88% -6.66%
=========================================
Files 15 11 -4
Lines 2001 508 -1493
=========================================
- Hits 271 35 -236
+ Misses 1684 470 -1214
+ Partials 46 3 -43
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
Do you think the branch was created from main? I see commits from the golangci-lint P. Could you please remove those commits to simplify the review 🙏 ? |
|
@mdelapenya definitely can separate it out once before I transition it from a draft -> ready for review. I mentioned in the PR body that c3de1bf is the only commit for #559 |
dd3f05e to
a469e91
Compare
|
@mdelapenya I've removed the golanglint-ci commits, feel free to take another peek! I haven't had time to add documentation and clean up the existing strategies. If you're comfortable with merging as is I can follow up with Documentation & a Strategy refactor in separate pull requests |
|
@hhsnopek could you update the docs for all the wait strategies here https://golang.testcontainers.org/features/wait/introduction? 🙏 I think this is the only thing I'm missing at the moment |
design: testcontainers#559 - add: Strategy#Timeout - add: MultiStrategy#WithDeadline - add: NopStrategy & NopStrategyTarget - deprecate: MultiStrategy#WithStartupTimeout
|
@mdelapenya all set here 🚀 |
mdelapenya
left a comment
There was a problem hiding this comment.
Very well structured, thanks for the change. I'm adding a few minor comments that need to be addressed.
Once resolved, I think we can move this little one on.
As always, thanks for your hard work here!
| } | ||
|
|
||
| // StrategyTimeout allows MultiStrategy to configure a Strategy's Timeout | ||
| type StrategyTimeout interface { |
There was a problem hiding this comment.
As a follow-up PR, let's add docs on how to create new wait strategies, using both interfaces.

Context
This pull request implements #559, see the design for details.
TODO:
[ ] Refactor/Clean up StrategiesWhile implementing this, I struggled to extend existing strategies due to the use of
StrategyandStrategyTargetabstracts. I have implemented or tested my assumptions but using Functional Options instead of Method Chaining would open the API further and expose less of the inner API details. I may suggest this in a future discussion/iteration. For this implementation, I continued the method chaining and was forced to exposeStrategy#Timeoutto check if the wait strategies had a timeout defined.This pull request requires #569 to merge as the work is based on those foundational changes. See c3de1bf for the only commit used for #559
closes #559