Skip to content

Decouple shared API tests from concrete mock implementations #3738

Open

Description

@adamtheturtle

Part of #3737.

The shared API suite currently couples backend selection, setup, and helper operations in tests/mock_vws/fixtures/vuforia_backends.py and related modules. Decouple these while both implementations remain in this repository, so the suite can later run with a backend supplied by another repository.

Acceptance criteria:

  • Define a small typed backend/fixture contract for API clients and endpoint URLs, database setup/reset, and mock controls such as adding databases and seeding recognition counts.
  • Separate backend selection from setup/lifecycle fixtures. Keep backend identities and selection results inside adapters; shared setup fixtures must return None (or yield None with teardown), so shared autouse dependencies can use None instead of object. Preserve backend parametrization, skip policy, and setup/cleanup behavior. Do not merely annotate the current enum-returning fixtures as None.
  • Keep implementation setup and concrete imports in backend adapters. Shared assertions and helpers must not import Flask or branch on concrete backend identities.
  • Replace hardcoded Vuforia endpoint URLs in client/prepared-request helpers with supplied URLs, including Model Target requests and report downloads.
  • Use synthetic credentials for mock runs; keep real-Vuforia credentials and account-specific restrictions in the explicit real backend.
  • Preserve shared coverage for in-memory and Flask adapters, mock-only cases, and applicable real-Vuforia verification. Keep tests of implementation-specific behavior local to their implementation.
  • Verify that the shared suite runs against both existing mock adapters, with existing coverage requirements and CI partition checks preserved.

Implemented in merged PRs #3759 and #3760: shared API fixtures load independently of adapter registration; backend selection stays internal to adapters; shared setup/lifecycle fixtures yield None, replacing the transitional object annotations. The remaining decoupling criteria above still apply.

Completion point: the same shared assertions run through either adapter without importing either implementation in the shared suite. Packaging and the repository move are separate follow-up 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