testcontainers / testcontainers-go

Testcontainers for Go is a Go package that makes it simple to create and clean up container-based dependencies for automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers that should be run as part of a test and clean up those resources when the test is done.
https://golang.testcontainers.org
MIT License
3.64k stars 500 forks source link

[Modules]: add examples/modules on the most uses services/images #636

Closed mdelapenya closed 5 months ago

mdelapenya commented 1 year ago

Proposal

Given there is a tool to generate the scaffolding for new examples as Go modules (https://golang.testcontainers.org/examples), let's use it to start adding examples.

We have elaborated the list below from Testcontainers for Java. If you're interested in adding any example, please comment here the module you want to work on (we'll add your username to next to it in the list), use the tool to generate the scaffolding for the module you are interested in, and send a PR. We'll link your PR here next to the item in the list.

Our recommendation is to visit the Java module and start porting its behavior and settings to the Go example module.

Modules

ravilushqa commented 1 year ago

@mdelapenya can I pick mongodb?

mdelapenya commented 1 year ago

@mdelapenya can I pick mongodb?

Please do it! 🙏

fbiville commented 1 year ago

Interested in tackling Neo4j :)

mdelapenya commented 1 year ago

Interested in tackling Neo4j :)

@fbiville Amazing! Please do it, and thanks for your support :)

I created the subtask for you: https://github.com/testcontainers/testcontainers-go/issues/921

Tingaev commented 1 year ago

@mdelapenya can I pick RabbitMQ?

mdelapenya commented 1 year ago

@mdelapenya can I pick RabbitMQ?

@Tingaev please go for it! Do you want to create an example or a real Go module? We should probably communicate the difference in a clearer manner, but modules for designed as dependencies to be consumed by downstream project, and examples for simply demonstrations, copying the code snippets, which include private APIs. Whatever you prefer is welcome

Tingaev commented 1 year ago

Do you want to create an example or a real Go module?

@mdelapenya I thought and decided to make a module instead of just an example I will close the PR with an example

mdelapenya commented 1 year ago

Do you want to create an example or a real Go module?

@mdelapenya I thought and decided to make a module instead of just an example I will close the PR with an example

@Tingaev please take a look at https://github.com/testcontainers/testcontainers-go/pull/1016/files#diff-bf2f2ea9f93d17fd1a016e2893c5b7fe7dae04263b1662c8e03926e4e728f495. In this PR we try to explain how to create it

adoublef commented 1 year ago

I would be keen to including a NATS example (possibly module in the future) what would be required to do so?

eddumelendez commented 1 year ago

@adoublef you can probably start with a NATS example similar to what we have in Testcontainers for Java, see this. If you know more about NATS and how Testcontainers can help then we are all ears to build a NATS module.

adoublef commented 1 year ago

@eddumelendez cool, I have been in the slack groups for a while & been learning how to use NATS personally so will be able to showcase a usage. I also know from the NATS slack group, a lot are using jetstream.

I could likely port this over as I have found myself being able to get this working on many small projects

EDIT: I have forked and created an example for NATS here would the next step in the process be to submit a PR? what would be recommended.

mdelapenya commented 1 year ago

@adoublef I'd suggest starting with an example is great for experimenting with a module, like an incubation stage. Once you are happy with it, you could convert it into a real module, as described in https://golang.testcontainers.org/modules

You could use the code generation tool to bootstrap the scaffolding, and/or migrate the existing example following this:

Please consider that the modules design is still in dev (see https://github.com/testcontainers/testcontainers-go/pull/1042) so it's evolving using proper, better abstractions in it.

mritunjaysharma394 commented 1 year ago

Hi @mdelapenya, I am interested for k3s, can i pick iit up :))

Thanks!

mdelapenya commented 1 year ago

@mritunjaysharma394 be my guest and do it! There is a Java implementation you can follow (j terms of API), will post here a link to it as I'm AFK

mritunjaysharma394 commented 1 year ago

That was quick, thanks a lot @mdelapenya, I guess you meant this link right?

also, loving this blog by you already!

adoublef commented 9 months ago

I wanted to request adding a minio module? I have a version that I use in a persoanl sdk where the API is near enough similar to what I'd find with the official modules.

Cc @mdelapenya

mdelapenya commented 5 months ago

I'm going to close this issue, as the modules catalog has grown a lot, and I think we do not need to track them all here.

Thank you all for your work creating modules!