Skip to content

Package the shared API contract suite for reuse from another repository #3739

Open

Description

@adamtheturtle

Part of #3737.

Blocked by #3738.

Make the shared API contract suite an installable Python package maintained in this repository, so the server repository can consume one authoritative copy of the tests.

Proposed layout: a separately buildable contract-tests/ subproject with a unique import namespace such as vws_mock_contract_tests. This package is a development dependency of consumers, not a server runtime dependency. It can initially be installed from a Git dependency pinned to a commit and subdirectory; a separate PyPI release is optional.

Acceptance criteria:

  • Package shared API test modules, fixtures, helpers, and required assets. Keep core interception tests and Flask/deployment-specific tests outside the shared package.
  • Provide an explicitly loadable pytest plugin for shared fixtures. Backend adapters supplied by each consuming repository must also load explicitly; do not rely on a consumer's local conftest.py applying to installed tests.
  • Document the setup/lifecycle contract established in Decouple shared API tests from concrete mock implementations #3738: shared setup fixtures return or yield None, while backend selection remains internal to the adapter. Verify this contract in the separate consumer smoke run.
  • Support collecting the installed suite with pytest --pyargs and document installation, invocation, adapter requirements, and version/revision compatibility.
  • Verify the built package from a separate working directory, without the core repository's tests or root conftest.py on the import path. Include a consumer smoke run through the existing Flask adapter.
  • Run the same packaged suite in core CI, with collection/partition checks and coverage attribution updated appropriately, so there is no second maintained copy of the assertions.
  • Ensure mock suite installation and execution require no real-Vuforia secrets and do not import Flask unless the chosen adapter requires it.

Completion point: another project can install the suite and run it with an explicit backend plugin. The server extraction is separate work.

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