This guide explains how to execute the integration test suite in an environment where docker
or docker-compose
are unavailable. Ensure neither tool is installed before continuing. If either command prints a version number, use the container-based workflow instead.
# Check for docker and docker-compose
command -v docker && docker --version
command -v docker-compose && docker-compose --version
sudo apt-get update
sudo apt-get install -y postgresql
sudo -u postgres /usr/lib/postgresql/16/bin/pg_ctl \
-D /etc/postgresql/16/main \
-l /tmp/postgresql.log start
sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'postgres';"
sudo -u postgres psql -c 'CREATE DATABASE "postgresTest";'
curl -L https://archive.apache.org/dist/kafka/3.6.0/kafka_2.13-3.6.0.tgz -o kafka.tgz
tar -xzf kafka.tgz
bash kafka_2.13-3.6.0/bin/zookeeper-server-start.sh -daemon kafka_2.13-3.6.0/config/zookeeper.properties
bash kafka_2.13-3.6.0/bin/kafka-server-start.sh -daemon kafka_2.13-3.6.0/config/server.properties
Create the required topics:
for t in test.topic.1 test.topic.2
do
kafka_2.13-3.6.0/bin/kafka-topics.sh --create --if-not-exists \
--bootstrap-server localhost:9092 --topic "$t"
done
Navigate to the repository root and run the suite:
go test -failfast -tags=integration ./...
The tests should complete successfully if PostgreSQL and Kafka are running and the environment variables match your setup.