Skip to content

Fill test coverage gaps for battle-hardened 1.0.0 #87

Description

@engenb

Problem

The existing ~400 integration tests cover happy-path scenarios well, but several error paths and edge cases are not exercised. These are the categories most likely to produce 500s or incorrect behavior in production.

Gaps to address

Query option error handling (should return 400, not 500)

  • $top with a non-integer value (?$top=abc)
  • $skip with a negative value (?$skip=-1)
  • $top exceeding MaxTop configuration
  • $filter referencing a property that doesn't exist on the model
  • $orderby with an invalid direction keyword

ETag edge cases

  • If-Match: * wildcard — must match any existing ETag (OData spec §8.2.5)
  • If-None-Match: * — must fail if entity exists (use with DELETE)
  • Multiple ETag values in If-Match header (If-Match: "a", "b")
  • ETag mismatch on DELETE returns 412
  • If-None-Match on GET returns 304 when ETag matches

Expand depth

  • $expand on a property that isn't registered as a navigation route returns 400
  • Nested $expand (e.g., $expand=Orders($expand=Items)) doesn't stack overflow

Pagination interaction

  • $count=true combined with $top/$skip — count reflects the unfiltered total, not the page size
  • Prefer: maxpagesize=N with GetQueryable path
  • nextLink in response is a valid, followable URL

Auth failure scenarios

  • Unauthenticated request to a RequireAuthorization() entity set returns 401
  • Authenticated but unauthorized request returns 403
  • Auth requirements don't bleed between entity sets

Concurrency

  • Concurrent POSTs with the same key — second should fail cleanly (not 500)
  • Concurrent DELETE + GET on the same entity

$search

  • Search handler configured — returns filtered results
  • Search handler not configured — returns 501

Acceptance criteria

  • Each bullet above has at least one corresponding test method
  • All new tests pass in CI
  • No existing tests broken

Metadata

Metadata

Assignees

No one assigned

    Labels

    high-priorityMust be resolved before 1.0.0 shipstestingTest coverage and correctness

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions