Skip to content

Tech Debt: Containerized Acceptance Testing Strategy (E2E) #86

@sagar-code-git

Description

@sagar-code-git

Tech Debt: Containerized Acceptance Testing Strategy (E2E)

Context

During acceptance testing we identified a gap in the async-request-backend repository:
there is no defined strategy for building and running containers specifically for end‑to‑end acceptance tests.

  • Current State: Unit and integration tests exist, but they run in isolation or with mocked components.
  • Risk: The contract between the request‑api (producer) and request‑processor (consumer) may break without detection until deployment.
  • Impact: Lack of reproducible acceptance testing increases the chance of regressions in asynchronous workflows.

Problem Statement

We need a containerized strategy to spin up all required services (Postgres, Request API, Request Processor, Celery worker queue) so acceptance tests can run against a real environment.
This is technical debt because the absence of such a strategy makes our testing incomplete and fragile.


Proposed Remediation

Adopt a “Spin Up, Trigger” strategy:

  • Infrastructure: Create a dedicated docker-compose.test.yml to spin up Postgres,celery sqs, Request API, and Request Processor.
  • Test Logic: Update acceptance tests to issue a real HTTP POST to the API and poll the status endpoint until the Worker updates the DB to COMPLETED.
  • CI/CD: Update GitHub Actions workflow (test.yml) to launch these containers before running the test suite.
  • Maintenance: Update Makefiles to separate unit tests from containerized acceptance tests.

Tasks

  • Create docker-compose.test.yml with Postgres, celery sqs, Request API, Request Processor.
  • Ensure Dockerfiles support environment variables (DATABASE_URL, CELERY_BROKER_URL).
  • Update acceptance tests to use real HTTP requests and polling.
  • Modify GitHub Actions workflow to run acceptance tests in containers.
  • Update Makefiles to split unit vs. acceptance test targets.

Acceptance Criteria

  • Running docker compose locally starts all required services.
  • GitHub Action acceptance tests job passes green.
  • No mocked databases; acceptance scope must use containerized Postgres.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions