- Remove t.Parallel() from tests that use gin.SetMode()
- gin.SetMode() modifies global state and is not thread-safe
- Tests affected:
* TestRequestIDMiddleware_GenerateNewID
* TestRequestIDMiddleware_UseExistingID
* TestLoggingMiddleware
* TestLoggingMiddleware_WithRequestID
* TestRequestIDMiddleware_MultipleRequests
- Add comments explaining why these tests cannot run in parallel
- All tests now pass with race detector enabled (-race flag)
This fixes data race warnings that were occurring when running tests
with the race detector, specifically when multiple tests tried to set
Gin's mode concurrently.
- Improve test file detection with more robust find command
- Use explicit variable assignment instead of pipe to grep
- Add debug output to show found test files
- Handle errors gracefully with 2>/dev/null || true
- Downgrade actions for Gitea compatibility
- upload-artifact@v4 -> v3 (Gitea doesn't support v4+)
- codecov-action@v4 -> v3 (preventive downgrade)
- Add Alpine Linux build dependencies installation step
- Install build-base and musl-dev when running on Alpine
- Required for CGO-enabled builds and race detector
- Disable CGO for verify build step when no tests exist
- Avoids requiring C build tools for simple compilation check
- Add tests for internal/config package (90.9% coverage)
- Test all viperConfig getter methods
- Test LoadConfig with default and environment-specific configs
- Test error handling for missing config files
- Add tests for internal/di package (88.1% coverage)
- Test Container lifecycle (NewContainer, Start, Stop)
- Test providers (ProvideConfig, ProvideLogger, CoreModule)
- Test lifecycle hooks registration
- Include mock implementations for testing
- Add tests for internal/logger package (96.5% coverage)
- Test zapLogger with JSON and console formats
- Test all logging levels and methods
- Test middleware (RequestIDMiddleware, LoggingMiddleware)
- Test context helper functions
- Include benchmark tests
- Update CI workflow to skip tests when no test files exist
- Add conditional test execution based on test file presence
- Add timeout for test execution
- Verify build when no tests are present
All tests follow Go best practices with table-driven patterns,
parallel execution where safe, and comprehensive coverage.
Implemented all 5 stories from Epic 0:
Story 0.1: Project Initialization
- Initialize Go module with path git.dcentral.systems/toolz/goplt
- Create complete directory structure (cmd/, internal/, pkg/, modules/, config/, etc.)
- Add comprehensive .gitignore for Go projects
- Create README.md with project overview and setup instructions
Story 0.2: Configuration Management System
- Define ConfigProvider interface in pkg/config
- Implement Viper-based configuration in internal/config
- Create configuration loader with environment support
- Add default, development, and production YAML config files
Story 0.3: Structured Logging System
- Define Logger interface in pkg/logger
- Implement Zap-based logger in internal/logger
- Add request ID middleware for Gin
- Create global logger export with convenience functions
- Support context-aware logging with request/user ID extraction
Story 0.4: CI/CD Pipeline
- Create GitHub Actions workflow for CI (test, lint, build, fmt)
- Add comprehensive Makefile with development commands
- Configure golangci-lint with reasonable defaults
Story 0.5: Dependency Injection and Bootstrap
- Create FX-based DI container in internal/di
- Implement provider functions for Config and Logger
- Create application entry point in cmd/platform/main.go
- Add lifecycle management with graceful shutdown
All acceptance criteria met:
- go build ./cmd/platform succeeds
- go test ./... runs successfully
- go mod verify passes
- Config loads from config/default.yaml
- Logger can be injected and used
- Application starts and shuts down gracefully
- Add comprehensive 8-phase implementation plan (docs/plan.md)
- Add 28 Architecture Decision Records (docs/adr/) covering all phases
- Add task tracking system with 283+ task files (docs/stories/)
- Add task generator script for automated task file creation
- Add reference playbooks and requirements documentation
This commit establishes the complete planning foundation for the Go
Platform implementation, documenting all architectural decisions and
providing detailed task breakdown for Phases 0-8.