Skip to content

Add consumer REST API tests, fix OffsetAndMetadata bug, update docs#74

Merged
haochenpan merged 2 commits intomainfrom
web-refactor
Mar 1, 2026
Merged

Add consumer REST API tests, fix OffsetAndMetadata bug, update docs#74
haochenpan merged 2 commits intomainfrom
web-refactor

Conversation

@haochenpan
Copy link
Owner

Summary

  • Add comprehensive tests for the consumer REST API: 69 unit tests (mocked KafkaConsumer) and 12 integration tests (real MSK) in tests/consumer_service_test.py, plus 46 route handler tests in tests/main_test.py
  • Fix production bug in consumer_service.py where OffsetAndMetadata was called with 2 args instead of 3 (missing leader_epoch)
  • Update docs/web/api.md with new live deployment URL, SDK auth instructions, and curl examples for all endpoints
  • Reorder API tag groups to: User, Authentication, Namespace, Topic, Consumer
  • Remove unused testing/ module

Test plan

  • All 177 unit tests pass (pytest -m "not integration")
  • All 12 integration tests pass against real MSK (pytest -m integration)
  • All 279 tests in the repo pass (pytest tests/)
  • Pre-commit hooks pass (ruff, mypy, detect-secrets)
  • Verified curl commands work against live deployment

🤖 Generated with Claude Code

haochenpan and others added 2 commits March 1, 2026 16:21
…docs

- Add tests/consumer_service_test.py with 69 unit tests and 12 integration
  tests covering all 13 consumer REST API endpoints
- Add 46 route handler tests to tests/main_test.py for auth, namespace
  validation, and happy paths
- Fix production bug: OffsetAndMetadata missing leader_epoch argument in
  consumer_service.py commit_offsets
- Update docs/web/api.md with new live URL, SDK auth instructions, and
  curl examples for all endpoints
- Reorder API tags: User, Authentication, Namespace, Topic, Consumer
- Relax ruff/mypy lint rules for test files (PLR2004, PLC0415, RUF059,
  PT021, and mypy error codes for test-specific patterns)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@haochenpan haochenpan merged commit 42026c0 into main Mar 1, 2026
2 checks passed
@haochenpan haochenpan deleted the web-refactor branch March 1, 2026 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant