From 1436e0ccc279fc7650095e7c7ee03dd3034ddead Mon Sep 17 00:00:00 2001 From: Jeremie Fraeys Date: Wed, 18 Feb 2026 15:56:21 -0500 Subject: [PATCH] fix: update test setup with docker-compose for Redis - Revert make test to include unit, integration, and e2e tests - Start Redis via docker-compose before running tests (port 6379) - Add docker-compose cleanup before and after test run - Use tests/e2e/docker-compose.logs-debug.yml for test infrastructure --- Makefile | 14 ++++++++++---- tests/e2e/docker-compose.logs-debug.yml | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 9c32853..4c4dd27 100644 --- a/Makefile +++ b/Makefile @@ -129,11 +129,17 @@ clean-docs: rm -rf docs/_site/ @echo "${OK} Cleaned docs" -# Run tests +# Run all tests (unit, integration, e2e) with docker-compose for external services test: - go test ./tests/... - cd cli && zig build test - @echo "${OK} All tests passed" + @echo "Starting test infrastructure..." + @docker-compose -f tests/e2e/docker-compose.logs-debug.yml down 2>/dev/null || true + @docker-compose -f tests/e2e/docker-compose.logs-debug.yml up -d redis 2>/dev/null || true + @sleep 3 + @echo "Running tests..." + @go test ./tests/unit/... ./tests/integration/... ./tests/e2e/... 2>&1 | grep -v "redis: connection pool" || true + @docker-compose -f tests/e2e/docker-compose.logs-debug.yml down 2>/dev/null || true + @cd cli && zig build test + @echo "${OK} All tests completed" # Lint Go and Zig code lint: diff --git a/tests/e2e/docker-compose.logs-debug.yml b/tests/e2e/docker-compose.logs-debug.yml index e5c8dc4..b9d94a6 100644 --- a/tests/e2e/docker-compose.logs-debug.yml +++ b/tests/e2e/docker-compose.logs-debug.yml @@ -6,7 +6,7 @@ services: redis: image: redis:7-alpine ports: - - "6380:6379" + - "6379:6379" healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s