Mock Web APIs with Testcontainers in Go

  Рет қаралды 2,087

eldr-io

eldr-io

Күн бұрын

#golang #coding #testing #integration #api #tutorial
In this video I show you can spin up custom docker images using Testcontainers automatically in your integration tests, and I show how you can easily spin up a custom web API inside the container to integration your code.
This is a great way to make your integration tests do almost anything, you have the power of Docker at your fingertips and can mock most anything to test properly integrating with 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/

Пікірлер: 10
@eldr-io
@eldr-io 26 күн бұрын
The repo for the code in this tutorial is here: github.com/sigrdrifa/testcontainers-go-api And the editor I use is Neovide (neovim), the config is here: github.com/sigrdrifa/nvim thanks for watching!
@Difcar
@Difcar 19 күн бұрын
A really clear and easy to follow explanation! Thanks :)
@NeuroDrizz
@NeuroDrizz 26 күн бұрын
Pretty cool, elegant implementation.
@jswlprtk
@jswlprtk 27 күн бұрын
Your neovim config is amazing! Looks very similar to the Lite-XL text editor. Is there a place where I can find your neovim config(dotfiles)?
@eldr-io
@eldr-io 26 күн бұрын
Sure thing, see the pinned comment
@raptorate2872
@raptorate2872 27 күн бұрын
Thank you for this approach, i wanted a way to automate container tests that i was doing manually or through shell scripts remotely. With test containers, i could fire them up against live containers (pods) via kubernetes.
@SayfSentinel
@SayfSentinel 27 күн бұрын
Hi, i like the content, I'm a bit confused about the file path for the testcontainers.ContainerRequest... the file path is "./test/integration/test-server/Dockerfile", but the dot means the current directory but the file is inside integration folder...😕
@eldr-io
@eldr-io 26 күн бұрын
Hey, yea its a bit confusing but it's actually because that path is relative to the build context of the ContainerRequest, which we've set to the root of the project, and so the dot resolves to the project root and therefore we need the full path to the Dockerfile (from the root). Hope that makes sense
@gpltaylor
@gpltaylor 27 күн бұрын
Can you post what Nvim plugin you're using for the Terminal?
@eldr-io
@eldr-io 26 күн бұрын
Sure thing, see the pinned comment
Testcontainers have forever changed the way I write tests
12:11
Dreams of Code
Рет қаралды 99 М.
The Noodle Stamp Secret 😱 #shorts
00:30
Mr DegrEE
Рет қаралды 62 МЛН
How did CatNap end up in Luca cartoon?🙀
00:16
LOL
Рет қаралды 7 МЛН
Balloon Pop Racing Is INTENSE!!!
01:00
A4
Рет қаралды 17 МЛН
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 118 #shorts
00:30
5 Rules For DTOs
17:56
Ardalis
Рет қаралды 35 М.
Creating a JSON CRUD API in Go (Gin/GORM)
34:08
Coding with Robby
Рет қаралды 104 М.
Why Does Scrum Make Programmers HATE Coding?
16:14
Thriving Technologist
Рет қаралды 484 М.
Making Minimalist Web Server in C on Linux
10:23
Nir Lichtman
Рет қаралды 188 М.
30 Vim commands you NEED TO KNOW (in just 10 minutes)
10:27
typecraft
Рет қаралды 43 М.
How to create your Golang APIs from now on with v1.22
12:51
Apple. 10 Интересных Фактов
24:26
Dameoz
Рет қаралды 111 М.
Why spend $10.000 on a flashlight when these are $200🗿
0:12
NIGHTOPERATOR
Рет қаралды 18 МЛН
Вы поможете украсть ваш iPhone
0:56
Romancev768
Рет қаралды 654 М.