Test your Go code with Testcontainers

2024 ж. 19 Сәу.
3 033 Рет қаралды

#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/

Пікірлер
  • 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!

    @eldr-io@eldr-io13 күн бұрын
  • 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

    @user-hi3dj6wh7d@user-hi3dj6wh7d13 күн бұрын
  • wow this is awesome!! thanks for sharing

    @aldrickdev@aldrickdev9 күн бұрын
  • 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

    @afsdab@afsdab13 күн бұрын
  • Great! Never seen this before so thanks a lot

    @coffeeintocode@coffeeintocode13 күн бұрын
  • I feel like this is a very complicated alternative to mocks, which are already an anti pattern.

    @Nonsense116@Nonsense11611 күн бұрын
  • Thanks a lot. It was inspirational to me. Cheers ! I've already subscribed your channel.

    @GoWithAndy-cp8tz@GoWithAndy-cp8tz12 күн бұрын
  • 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.

    @luizfernandopereira5120@luizfernandopereira512012 күн бұрын
  • 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?

    @user-hi3dj6wh7d@user-hi3dj6wh7d13 күн бұрын
    • 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

      @eldr-io@eldr-io13 күн бұрын
  • Are we supposed to believe that's really you in the profile and thumbnails? lolll

    @avi7278@avi727812 күн бұрын
    • It's an AI for sure :D, different chair in every thumbnail.

      @filiplaubert5001@filiplaubert500112 күн бұрын
    • @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.

      @avi7278@avi72788 күн бұрын
  • nice try fed you can't hide behind a coding girl persona on youtube!!!

    @NeverTrust298@NeverTrust29812 күн бұрын
  • how pathetic

    @schwarzarbyter@schwarzarbyter2 күн бұрын
KZhead