Skip to content

Conversation

@fahimfaisaal
Copy link
Member

This commit adds dockertest integration to automatically spin up and manage Redis containers during test execution, eliminating the need for a pre-running Redis server.

Changes

New Files

  • Makefile: Added with test, format, and release targets
  • testutils_test.go: Dockertest setup using TestMain pattern
    • Automatically starts Redis container before tests
    • Cleans up container after tests complete
    • Exposes getTestRedisURL() for all test files

Modified Files

  • queue_test.go: Removed getTestRedisURL() function and godotenv import (now centralized in testutils_test.go)
  • .github/workflows/redisq.yml: Removed Redis service definition and REDIS_URL env variable since dockertest handles this
  • .gitignore: Added coverage.txt
  • go.mod/go.sum: Added dockertest dependency, removed godotenv

Benefits

  • No external Redis dependency required for local testing
  • Consistent test environment across local and CI
  • Simplified CI workflow configuration
  • Tests are now fully self-contained

This commit adds dockertest integration to automatically spin up and
manage Redis containers during test execution, eliminating the need
for a pre-running Redis server.

## Changes

### New Files
- Makefile: Added with test, format, and release targets
- testutils_test.go: Dockertest setup using TestMain pattern
  - Automatically starts Redis container before tests
  - Cleans up container after tests complete
  - Exposes getTestRedisURL() for all test files

### Modified Files
- queue_test.go: Removed getTestRedisURL() function and godotenv
  import (now centralized in testutils_test.go)
- .github/workflows/redisq.yml: Removed Redis service definition
  and REDIS_URL env variable since dockertest handles this
- .gitignore: Added coverage.txt
- go.mod/go.sum: Added dockertest dependency, removed godotenv

## Benefits
- No external Redis dependency required for local testing
- Consistent test environment across local and CI
- Simplified CI workflow configuration
- Tests are now fully self-contained
@fahimfaisaal fahimfaisaal merged commit 72a8cb6 into main Jan 29, 2026
1 check passed
@fahimfaisaal fahimfaisaal deleted the feat/dockertest-integration branch January 29, 2026 11:10
@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants