testcontainers / testcontainers-clj

Control Docker containers from your test lifecycle for Clojure integration tests.
Eclipse Public License 1.0
145 stars 14 forks source link

Add support for a container wait stategy #25

Closed javahippie closed 3 years ago

javahippie commented 4 years ago

Some containers need some time to initialize properly, so users should be able to decide for a wait strategy

javahippie commented 4 years ago

https://www.testcontainers.org/features/startup_and_waits/

javahippie commented 4 years ago

To Do:

javahippie commented 4 years ago

@dharrigan After the merge, the formatting error occurred on my machine, too. I thought I had the GitHub config OS independent, but apparently it's not working, yet. What operating system are you using? Do you have global Git configs installed which rewrite line-endings?

Also I would like to enhance the wait strategies a little. E.g. the HTTP Wait strategy for the Java library accepts a lot more properties, e.g. Timeout, TLS, response codes, ports and basic authentication. If the current version is something you need in the library, soon, we can add it and enhance it later, but if you can wait a week or two longer, I would try and provide the complete feature set in this wrapper, too

dharrigan commented 4 years ago

Hi,

I use Arch :-) And yes, I have a global .gitconfig, but I think it's vim which is doing stuff, formatting as I edit the file. Certainly I can run lein cljstyle check --report in the future before committing to ensure it follows the style you have set :-)

I agree completely with enhancements. What I did was the first iteration :-) It certainly an be extended with more goodness! :-)

javahippie commented 3 years ago

@dharrigan I am currently in the process of adding additional wait configurations to the HTTP strategy (just that there is no collision ;) )

While working with the code I had the idea of moving (.waitingFor container (Wait/...)) out of the multimethods. The methods would then return a WaitStrategy object, which would result in only one .waitingFor call in the init method. What do you think of the approach? Do you see any disadvantages with this?

dharrigan commented 3 years ago

Hi,

Sounds good! Give it a whirl! :-)

javahippie commented 3 years ago

Closing to fit it into the 0.3.0 release, opening new issues for extended wait strategy features