Skip to content

Support methods without streams by testing/codegen#205

Merged
raphael merged 5 commits into
v3from
testing-http-harness-without-stream
Sep 21, 2025
Merged

Support methods without streams by testing/codegen#205
raphael merged 5 commits into
v3from
testing-http-harness-without-stream

Conversation

@tchssk
Copy link
Copy Markdown
Member

@tchssk tchssk commented Sep 16, 2025

No description provided.

@tchssk tchssk requested a review from Copilot September 16, 2025 16:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for generating test harnesses for services without streaming methods by introducing conditional generation of WebSocket-related code. The change ensures that non-streaming services don't include unnecessary WebSocket infrastructure in their test harnesses.

  • Updates the HTTP harness template to conditionally include WebSocket upgrader and dialer based on whether the service has streaming methods
  • Adds test cases to verify correct code generation for both streaming and non-streaming services
  • Refactors the stream detection logic to use the IsStreaming() method instead of direct field comparison

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
testing/codegen/templates/http_harness.go.tpl Conditionally generates WebSocket code based on .HasStreams template variable
testing/codegen/harness.go Updates stream detection to use IsStreaming() method
testing/codegen/harness_test.go Adds comprehensive tests for both streaming and non-streaming services
testing/codegen/testdata/dsls.go Provides test DSL definitions for services with and without streams
testing/codegen/testdata/code.go Contains expected generated code for test validation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread testing/codegen/testdata/code.go Outdated
@tchssk tchssk requested a review from Copilot September 16, 2025 16:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@tchssk tchssk marked this pull request as ready for review September 16, 2025 17:00
@raphael
Copy link
Copy Markdown
Member

raphael commented Sep 21, 2025

Very nice, thank you!

@raphael raphael merged commit 1a48710 into v3 Sep 21, 2025
5 checks passed
@raphael raphael deleted the testing-http-harness-without-stream branch September 21, 2025 06:28
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.

3 participants