Skip to content

Parameterize collection endpoint tests across media types, consolidate test infrastructure #96

Description

@mforce

What to build

Parameterize the collection endpoint test suites so all three media types get identical coverage, and consolidate the copy-pasted test infrastructure.

Today the movies/music/games endpoint test files triplicate 16 identically-named scenarios (auth, ownership, CRUD round-trips, tag handling, validation), while 11 further behaviors — currency normalization, boundary ratings, tag replacement semantics, cover URL handling, owner-scoped tags, and more — are verified for movies only even though the production code paths are byte-identical across the three types. The suite also re-declares response DTOs and Sample() factories per file, hand-rolls the same HTTP stub handler in four places, and boots a full web host per test (186 times), each boot replaying all migrations.

Convert the shared scenarios into one parameterized (or shared-base) suite that runs per media type, extract a single test-support module (DTOs, sample factories, stub-handler family, class-level host fixture), and align unit-level tests with the endpoint tests on the migration-based schema path so a model/migration divergence is visible to the whole suite.

This is the safety net for the collection-endpoint consolidation — it must land first.

Acceptance criteria

  • The shared CRUD/auth/ownership/validation/tag scenarios run against movies, music, and games from one definition
  • The behaviors currently verified only for movies are covered for music and games
  • Response DTOs, sample factories, and HTTP stub handlers are declared once in shared test support
  • Unit-level and endpoint-level tests build their schema the same way
  • Suite wall-clock time is the same or better than before

Blocked by

None — can start immediately.

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions