Skip to content

Test/reqresp v1 coverage#69

Merged
samcm merged 3 commits intofeat/per-protocol-encodingfrom
test/reqresp-v1-coverage
Jul 4, 2025
Merged

Test/reqresp v1 coverage#69
samcm merged 3 commits intofeat/per-protocol-encodingfrom
test/reqresp-v1-coverage

Conversation

@samcm
Copy link
Copy Markdown
Member

@samcm samcm commented Jul 4, 2025

No description provided.

samcm and others added 2 commits July 4, 2025 18:00
- Add tests for client.go covering SendRequest, retry logic, timeouts, and chunked requests
- Add tests for handler.go covering request handling, validation, and error responses
- Add tests for chunked_handler.go covering chunked responses and ChunkedResponseWriter
- Add tests for reqresp.go covering service lifecycle and concurrent operations
- Add tests for types.go covering Status, error constants, and configurations
- Create comprehensive mock implementations for host.Host, network.Stream, and other interfaces
- Achieve 72.6% test coverage, exceeding the >70% target

Test coverage breakdown:
- client.go: High coverage for core functionality
- handler.go: Excellent coverage (94.7% for HandleStream)
- chunked_handler.go: Excellent coverage (95% for HandleStream)
- types.go: 100% coverage for key functions
- reqresp.go: Good coverage for service operations
- Add unit tests for all major components
- Add mock implementations for libp2p interfaces
- Add panic recovery to handlers for robustness
- Add proper timeout handling with context
- Fix empty request validation
- Fix integration test race conditions
- All tests now pass successfully

Coverage highlights:
- Total package: 77.9%
- Handler.HandleStream: 94.7%
- ChunkedHandler.HandleStream: 95.0%
- Client.SendRequestWithOptions: 95.5%

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
@samcm samcm requested a review from mattevans as a code owner July 4, 2025 08:57
- Add blank line before return statements (nlreturn)
- Add blank line before if statements after assignments (wsl)
- All linting issues now resolved

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 4, 2025

Codecov Report

Attention: Patch coverage is 90.90909% with 3 lines in your changes missing coverage. Please review.

Please upload report for BASE (feat/per-protocol-encoding@f6e4048). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...onsensus/mimicry/p2p/reqresp/v1/chunked_handler.go 81.25% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@                      Coverage Diff                      @@
##             feat/per-protocol-encoding      #69   +/-   ##
=============================================================
  Coverage                              ?   42.73%           
=============================================================
  Files                                 ?       65           
  Lines                                 ?     6657           
  Branches                              ?        0           
=============================================================
  Hits                                  ?     2845           
  Misses                                ?     3516           
  Partials                              ?      296           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@samcm samcm merged commit bef20aa into feat/per-protocol-encoding Jul 4, 2025
1 of 2 checks passed
@samcm samcm deleted the test/reqresp-v1-coverage branch July 4, 2025 09:19
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