Skip to content

test(showcase): add showcase streaming integration test DO NOT REVIEW - #6191

Draft
suzmue wants to merge 4 commits into
googleapis:mainfrom
suzmue:showcase-streaming-integration
Draft

test(showcase): add showcase streaming integration test DO NOT REVIEW#6191
suzmue wants to merge 4 commits into
googleapis:mainfrom
suzmue:showcase-streaming-integration

Conversation

@suzmue

@suzmue suzmue commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Do not merge, this is to demo that the new code works.

This PR is based on googleapis/librarian#7071 with googleapis/librarian#7078

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces bidirectional streaming support for the Messaging service in the showcase crate, gated under the google_cloud_unstable_gapic_streaming feature flag. It adds the generated protobuf code, conversion traits, client and transport implementations for the connect method, and integration tests. Feedback on the integration test suggests asserting that a response is received from the stream using .expect() rather than silently passing on an empty stream.

Comment on lines +59 to +65
if let Some(res) = receiver.recv().await {
let response = res?;
println!(
"Successfully received bidi streaming response: {:?}",
response
);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using if let Some(res) = ... here means the test will silently pass if the stream is closed immediately and no response is ever received. To make the test robust and ensure we actually verify the received response, we should assert that we got Some response using .expect() as preferred by the Repository Style Guide for tests.

    let res = receiver.recv().await.expect("expected a response from the bidi stream");
    let response = res?;
    println!(
        "Successfully received bidi streaming response: {:?}",
        response
    );
References
  1. In tests, prefer ?. If that is not possible use .expect(). Only use .unwrap() as a last resort. (link)

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.59%. Comparing base (505ebf1) to head (cd42ef4).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6191   +/-   ##
=======================================
  Coverage   96.59%   96.59%           
=======================================
  Files         266      266           
  Lines       66852    66852           
=======================================
  Hits        64574    64574           
  Misses       2278     2278           

☔ 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.

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