Test your Go code with Testcontainers
Vložit
- čas přidán 19. 04. 2024
- #coding #golang #programming #testing #tutorial #testcontainers #mysql
In this video we will be looking at one of my favourite integration test virtualisation frameworks: testcontainers - and how to use it with Go. We programmatically spin up a MySQL database and configure it, all within Golang tests and connect a simple example MySQL database client to it.
Testcontainers is an open source framework for providing throwaway, lightweight instances of databases, message brokers, web browsers, or just about anything that can run in a Docker container.
testcontainers.com/ - Věda a technologie
The repo for the code in this tutorial is here: github.com/sigrdrifa/testcontainers-go
And the editor I use is Neovide (neovim), the config is here: github.com/sigrdrifa/nvim
thanks for watching!
you save my time. been thinking abt this since a day. thanks a lot.
looking forward for more such videos to test for kafka messaging and AWS based testing too for Go
Great video, I saw this tool in another blog posting and I have no idea what this tool does even after seeing the site hahah. Thanks for clarifying
wow this is awesome!! thanks for sharing
Great! Never seen this before so thanks a lot
Thanks a lot. It was inspirational to me. Cheers ! I've already subscribed your channel.
I feel like this is a very complicated alternative to mocks, which are already an anti pattern.
Even though its simplifies the spin up of depencency services in containers still a requirement to have docker runner to do it, so we are replacing a docker-compose.test like file with something that can be programatically created for each scenario. Sounds a great solution but I dont know exactaly how it would behave into a Ci/CD pipeline, if all of this containers would allocate a lot fo memory or space or even not shut down correctly causing currency problems.
may i know the editor you are using?
also can i request for the github repo or gist of the codeyou have done in this video?
The repo for the code in this tutorial is here: github.com/sigrdrifa/testcontainers-go
And the editor I use is Neovide (neovim), the config is here: github.com/sigrdrifa/nvim
Are we supposed to believe that's really you in the profile and thumbnails? lolll
It's an AI for sure :D, different chair in every thumbnail.
@silaspy-ff2ne it's obviously not even a girl, it's some dude using a voice changer and AI tatas for clicks. weird. enjoy, if that's your kinda thing.
nice try fed you can't hide behind a coding girl persona on youtube!!!
how pathetic