Skip to content

test(schema): add parameterized table test for errToStatus#392

Open
zeevdr wants to merge 1 commit into
mainfrom
issue-302-errtostatus-tests
Open

test(schema): add parameterized table test for errToStatus#392
zeevdr wants to merge 1 commit into
mainfrom
issue-302-errtostatus-tests

Conversation

@zeevdr
Copy link
Copy Markdown
Member

@zeevdr zeevdr commented May 14, 2026

Summary

  • errToStatus had no direct tests — only implicit coverage when service RPCs hit error paths.
  • A dedicated table test pins the gRPC code and message routing for each case at the lowest level, making regressions immediately visible without needing to trace through a full RPC call.
  • The wrapped-error case explicitly verifies that errors.Is semantics are honoured, not just pointer equality.

Test plan

  • TestErrToStatus/ErrNotFound_maps_to_NotFound — direct sentinel.
  • TestErrToStatus/wrapped_ErrNotFound_maps_to_NotFound — verifies errors.Is unwrapping.
  • TestErrToStatus/other_error_maps_to_Internal — any non-NotFound error → Internal.
  • All tests pass under go test ./internal/schema/....
  • make lint passes.

Closes #302

🤖 Generated with Claude Code

errToStatus had no direct tests. The table covers the direct ErrNotFound
sentinel, a wrapped ErrNotFound (verifying errors.Is semantics), and
any other error mapping to Internal — pinning the gRPC code and message
routing at the lowest level.

Co-Authored-By: Claude <noreply@anthropic.com>
Closes #302
@zeevdr zeevdr added this to the v0.11.0-alpha.2 milestone May 14, 2026
@zeevdr zeevdr added enhancement New feature or request server Server changes size: S Quick win — a few hours or less priority: P2 Nice-to-have labels May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: P2 Nice-to-have server Server changes size: S Quick win — a few hours or less

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parameterized table test for errToStatus error mapping

1 participant