ashupednekar / ashupednekar/compose
Add Tests
- Dominant language
- Go
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
The compose tool currently lacks comprehensive **automated tests** for verifying the correctness of the generated `docker-compose.yaml`. This makes it difficult to ensure features like **networking, host networking, and command handling** work correctly across different Helm charts.
Adding tests will improve reliability, prevent regressions, and provide a reference for future enhancements.
---
## Proposed Implementation
### 1. Test Scenarios
- **Sidecar & Microservice Networking**
- Verify containers in the same pod-like group share a Docker network.
- Test service discovery using container names/aliases.
- **Host Networking**
- Ensure `--enable-host-networking` sets `network_mode: host`.
- Validate no port conflicts occur when host networking is enabled.
- **Command Exclusion**
- Verify Bitnami and Distroless containers do not include `command` in Compose.
- Ensure other images preserve commands when specified.
- **Port Mapping**
- Check that ports are correctly mapped for bridge networks.
- **Multiple Helm Charts**
- Test isolated networks for different chart deployments.
### 2. Test Implementation
- Use the existing test framework in the project.
- Compare **generated `docker-compose.yaml`** against **expected outputs** stored as fixtures.
- Include tests for **networking, command handling, and host networking options**.
### 3. Fixtures & Automation
- Store sample Helm chart manifests in a **fixtures directory**.
- Maintain **expected Docker Compose outputs** for comparison.
- Automate test runs in CI/CD pipeline to catch regressions.
---
## Benefits
- Improves confidence in Helm-to-Docker Compose conversion.
- Prevents regressions when adding new features (e.g., host networking, command handling).
- Ensures consistency across Docker and Podman environments.
- Provides reference examples for users and contributors.
---
## Acceptance Criteria
- Automated tests cover:
- Networking and service discovery
- Host networking flag behavior
- Command exclusion for whitelisted images
- Port mappings
- Tests are **repeatable** and **deterministic**.
- CI/CD pipeline runs tests successfully for every commit.
- Test fixtures and expected outputs are version controlled.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.