Skip to content

[Wave 6 4/10] Coordinator API contract tests for orders, quotes, secrets, health, and metrics #27

Description

@karagozemin

Summary

Add coordinator API contract tests for orders, quotes, secrets, health, and metrics routes so the public service surface is guarded before mainnet hardening.

Context

  • Coordinator currently has service-level tests in coordinator/test/order-service.test.ts.
  • Route handlers under coordinator/src/server/routes/ expose the API consumed by the frontend/resolvers, but route-level regression coverage is thin.
  • Recent observability work added /metrics; that endpoint should stay valid Prometheus text as handlers evolve.

Scope

  • Add Supertest/Vitest route tests against the Express app without starting a real network port.
  • Cover success and validation-error paths for order creation/listing, quote responses, secret relay behavior, /health, and /metrics.
  • Keep tests independent of live RPCs and external services.

Acceptance criteria

  • pnpm --filter @oversync/coordinator test includes route-level API coverage.
  • /health returns stable service/version/uptime/timestamp fields.
  • /metrics returns Prometheus content type and includes coordinator metric names.
  • Invalid order/quote payloads return 4xx with useful error bodies.

Pointers

  • coordinator/src/server/app.ts
  • coordinator/src/server/routes/health.ts
  • coordinator/src/server/routes/metrics.ts
  • coordinator/src/server/routes/orders.ts
  • coordinator/src/server/routes/quotes.ts
  • coordinator/src/server/routes/secrets.ts
  • coordinator/test/order-service.test.ts

Complexity

Medium (API tests + validation edge cases)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions