Category Archives: Testing

Mock sql (sqlx) db on golang

I am using this library — That’s how you can use it for mocking db querying:

Fast and simple mock server app by swagger file

I’ve tried Mockoon for mocking by swagger/OpenAPI spec file, and it works pretty good. It autogenerates the response based on swagger format, and you are able to update any response field the way you want, save your changes and run the mock server with one click on the port you specify. It is a separate …

Read more

mmock for mocking microservices

It is a very easy to set up though pretty powerful tool with support for delays and handling query params. It also has a console for checking all the requests and corresponding responses matched. Here it is Below I describe a way to use it with docker-compose for local development.

Mocking for unit-tests and e2e-tests in golang

Some patterns to test your golang app. Mocking an interface Mocking SQL database Mocking HTTP server for unit-tests Stubbing HTTP server for e2e-tests Mocking for e2e-tests with dockertest

Integration tests with testcontainers-go

Here is the go library that simplifies integration tests with docker containers — That’s how you can use it to test sql — Project documentation — The idea is to prepare the environment, build your app, then make requests and check the DB state.

Test Push Notifications

Load testing tools [Tool | Free] [Tool | Free] [Tool | Free] [Tool | Free/$] [Tool | Free/SaaS] [Tool | Free] [SaaS | Free/$] [Tool | Free/$] [Tool | Free]

A way to test http client in go

A couple of ways are described here — The way I liked is the following one:

Golang: testing http and grpc servers

HTTP server is quite easy to test — here is a nice video about it:

E2E tests in go

I tried it via ginkgo and gomega. It has Agouti with WebDriver support out of the box, but I didn’t use it as we have grpc API. That’s the example (table tests):