Skip to content

[Test] Introduce Pact consumer-driven contract testing for Namespace & Table APIs across Java/Python/Rust clients #340

Description

@XuQianJin-Stars

Background / Motivation

lance-namespace currently ships a REST specification (OpenAPI) together
with three generated clients (Java / Python / Rust) and a Spring Boot
reference server. However, there is no automated mechanism to
guarantee that:

  1. The three language clients stay wire-compatible with the server.
  2. Changes to the server-side controllers do not silently break
    existing consumer expectations (request shape, response schema,
    error envelope).
  3. The ErrorResponse (error, code, type, detail) contract
    is uniformly enforced across every endpoint.

Traditional integration tests are too coarse for this: they rely on a
live server, do not pinpoint which side broke the contract, and give
no early feedback to consumer authors.

We propose adopting Pact consumer-driven
contract testing as the standard approach for cross-language API
contract assurance in this repository.


Proposal

Introduce a full Pact-based contract testing suite with a locked
"contract pack" serving as the single source of truth, covering
both Namespace and Table REST APIs (11 operations × success + 4xx
error scenarios).

APIs under contract

Domain Operations
Namespace API ListNamespaces, DescribeNamespace, CreateNamespace, DropNamespace, NamespaceExists
Table API ListTables, DescribeTable, TableExists, DropTable, RegisterTable, DeregisterTable

Each operation is covered by at least one 2xx success case and one
4xx error case
with the unified ErrorResponse schema.

google doc: https://docs.google.com/document/d/1Wju0Ema10OkuDLs8tYzZ0xXqihX65k-OYabZbnc5NbI/edit?usp=sharing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions