Skip to content

Add unit tests for MarshalerInputStream - #8784

Open
Vicky677 wants to merge 1 commit into
open-telemetry:mainfrom
Vicky677:grpc-unit-test-add
Open

Add unit tests for MarshalerInputStream#8784
Vicky677 wants to merge 1 commit into
open-telemetry:mainfrom
Vicky677:grpc-unit-test-add

Conversation

@Vicky677

@Vicky677 Vicky677 commented Sep 9, 2026

Copy link
Copy Markdown

Description

Adds comprehensive unit test coverage for io.opentelemetry.exporter.internal.grpc.MarshalerInputStream in opentelemetry-exporter-common.

Test scenarios covered:

  • available():
    • Checking available bytes when backed by a MessageWriter.
    • Checking available bytes when backed by a partial ByteArrayInputStream.
    • Returning 0 after the stream has been fully drained.
  • drainTo(OutputStream):
    • Draining directly from a MessageWriter.
    • Draining from an already existing partial stream.
    • Returning 0 written bytes when called on an already drained stream.
  • read() (single byte):
    • Reading single bytes sequentially until EOF (-1) from a MessageWriter.
    • Reading single bytes from a partial stream.
    • Returning -1 on already drained stream.
  • read(byte[], int, int) (bulk read):
    • Reading bulk byte array from a MessageWriter and verifying EOF on subsequent read.
    • Handling 0-length messages properly.
    • Reading bulk bytes from a partial stream.
    • Returning -1 on already drained stream.

@Vicky677
Vicky677 requested a review from a team as a code owner September 9, 2026 15:24
@linux-foundation-easycla

linux-foundation-easycla Bot commented Sep 9, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: Vicky677 / name: Abhishek.Ghosh11 (38251b8)

@Vicky677
Vicky677 marked this pull request as draft September 9, 2026 15:50
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Sep 12, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-09-12 10:50 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.37%. Comparing base (1270b3d) to head (42d5362).
⚠️ Report is 20 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8784      +/-   ##
============================================
+ Coverage     91.30%   91.37%   +0.07%     
- Complexity    10506    10537      +31     
============================================
  Files          1007     1008       +1     
  Lines         28373    28465      +92     
  Branches       3586     3617      +31     
============================================
+ Hits          25907    26011     +104     
+ Misses         1673     1658      -15     
- Partials        793      796       +3     

☔ View full report in Codecov by Harness.
📢 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.

@Vicky677
Vicky677 marked this pull request as ready for review September 12, 2026 10:50
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