testcontainers-rs icon indicating copy to clipboard operation
testcontainers-rs copied to clipboard

feat: builder API proposal

Open mbodmer opened this issue 6 months ago • 2 comments

Here is a proposal for a builder API.

Please comment and help me improve it if there is interest for it.

mbodmer avatar Jun 26 '25 11:06 mbodmer

Deploy Preview for testcontainers-rust ready!

Name Link
Latest commit 1248621491592fc637bd9d634e80d9db0416a831
Latest deploy log https://app.netlify.com/projects/testcontainers-rust/deploys/687a5e30a1acce00087ce211
Deploy Preview https://deploy-preview-801--testcontainers-rust.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Jun 26 '25 11:06 netlify[bot]

Thank you for the contribution 🙏

That's really useful enhancement, I'll take a look soon

I think https://github.com/testcontainers/testcontainers-rs/issues/478 can be addressed by this change

DDtKey avatar Jun 26 '25 12:06 DDtKey

Also we could drop/rework our testimages subcrate and utilize the builder in our tests instead

It's better to do as follow-up, but it would be a good exercise to check everything is working

DDtKey avatar Jul 01 '25 18:07 DDtKey

Also we could drop/rework our testimages subcrate and utilize the builder in our tests instead

It's better to do as follow-up, but it would be a good exercise to check everything is working

Yes, I think this would be a good idea, and I am willing to do this. But first I would like to hear whether the API as I have proposed for now is going in the direction you imagine.

mbodmer avatar Jul 01 '25 19:07 mbodmer

@mervyn-mccreight may I ask you to take a look at the design too, please?

This PR is extremely useful and I don't want the job to be lost, we need to finalize it

DDtKey avatar Jul 16 '25 16:07 DDtKey

Would be happy if this and the follow up #804 could be finalized soon, as long as I still remember what I did here :-) Willing to help if anything is missing

mbodmer avatar Jul 16 '25 20:07 mbodmer

Thanks for your detailed replies :) I resolved everything, because it's clear to me now. @DDtKey I'm quite happy with the design, WDYT?

mervyn-mccreight avatar Jul 17 '25 11:07 mervyn-mccreight

Thanks for your review.

mbodmer avatar Jul 17 '25 11:07 mbodmer

Few PRs have been merged (e.g bollard update), could you update the branch and solve conflicts?

DDtKey avatar Jul 17 '25 23:07 DDtKey

Ok, too bad. Merging was quite a pain and I hope I've not introduced some unintended side effects. Please lets rush with #804, I'd not be really happy having too many conflicts there again.

mbodmer avatar Jul 18 '25 09:07 mbodmer

Yes, I also think documentation would be needed. I will try to improve on it in a later effort, right now I am not in the mood for this :-). But I really see the importance.

mbodmer avatar Jul 18 '25 19:07 mbodmer

I'd say lets merge it and do the documentation in a later PR :) It's more than enough to go through merge pain once (thanks for doing that!)

mervyn-mccreight avatar Jul 18 '25 23:07 mervyn-mccreight