testing-kafka-in-go

module
v0.0.0-...-76f7a1c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2020 License: MIT

README

Integration testing of Go and Kafka using Gnomock

This is a sample program that features producer, consumer, reporter and handler packages. handler package exposes an API to submit new events, and get current submitted event numbers per account. In the backend, this program uses Kafka message broker to submit all received events and consume them to calculate usage statistics.

To test the program, I used Gnomock. In this case, I used it to create a temporary Kafka docker container, run tests against it using only the external web API (exposed by handler package), and verify the results.

This project includes a sample Github Actions job that runs integration test using a real Kafka container, and reporting code coverage for all packages.

Directories

Path Synopsis
Package consumer allows to consume messages from a message broker.
Package consumer allows to consume messages from a message broker.
Package handler exposes a web API to submit new events or get current usage statistics.
Package handler exposes a web API to submit new events or get current usage statistics.
Package producer allows to submit new messages to a message broker.
Package producer allows to submit new messages to a message broker.
Package reporter exposes a way to get up to date usage statistics based on arbitrary events.
Package reporter exposes a way to get up to date usage statistics based on arbitrary events.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳