Skip to content

[TEST] Add Contract Testing with Pact #168

@JoshuaAFerguson

Description

@JoshuaAFerguson

Objective

Implement contract testing to prevent API breaking changes.

Implementation

// Consumer test (UI):
pact.AddInteraction().
    Given("Session 123 exists").
    UponReceiving("A request for session details").
    WithRequest("GET", "/api/v1/sessions/123").
    WillRespondWith(200, map[string]string{
        "id": "123",
        "status": "running",
    })

Acceptance Criteria

  • Pact consumer tests in UI
  • Pact provider tests in API
  • Contract verification in CI/CD
  • Breaking changes detected

Files

  • ui/tests/pact/ (NEW)
  • api/tests/pact/ (NEW)
  • .github/workflows/contract-tests.yml (NEW)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions