Skip to content

Add integration tests with docker-compose #7

@mikkeldamsgaard

Description

@mikkeldamsgaard

Summary

Add end-to-end integration tests using docker-compose to test full workflows against real services.

Requirements

  • tests/docker-compose.yml with Postgres and an HTTP health-check server
  • Integration test file tests/integration_test.go (build tag: integration)
  • Test scenarios:
    1. wait-for TCP against Postgres → succeeds when Postgres is ready
    2. wait-for HTTP against health-check server → succeeds when server returns 200
    3. wait-for against non-existent service → fails with proper exit code after timeout
    4. render template with env vars → produces correct output file
    5. fetch from HTTP server → writes response to file
    6. exec runs command → captures output and exit code
    7. 'seed' for both mysql and postgresql. (Use postgres:16-alpine and mysql:8.0 images)
      • test create database extensively
  • CI integration: add an optional integration test job to .github/workflows/ci.yml

Acceptance Criteria

  • tests/docker-compose.yml with service definitions
  • tests/integration_test.go with all scenarios
  • Tests pass locally with docker-compose up -d && go test ./tests/ -tags=integration
  • CI job ( separate workflow)
  • CHANGELOG.md updated

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions