Integration Testing with Golang (Test Containers)

When someone tested the nitrogen filled tire with a lighter… — https://youtu.be/h9rUTBXBNPQ

What are the advantages?

Containers have multiple benefits for us and our applications. Less overhead, portability, more consistent operation and efficiency etc. In addition to all these, I think the most useful feature for our application is that it allows us to run the applications (db etc.) that we have developed with a single command, even if they are not installed on our computer.

How we can implement it?

I created a web application that has 2 endpoints as below;

controller.go
postgrsql.go
controller_integration_test.go
controller_integration_test.go
$ go test -v ./...
Result of tests

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Furkan Bozdag

Furkan Bozdag

158 Followers

I don’t know what’s happening here? | sr. software engineer