Skip to content

Conversation

@tchssk
Copy link
Member

@tchssk tchssk commented Oct 28, 2025

No description provided.

@tchssk tchssk marked this pull request as ready for review October 28, 2025 11:14
@tchssk tchssk requested a review from Copilot October 28, 2025 11:14
Copy link
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 fixes test suite generation by properly handling methods without payloads. It introduces a new test case WithPayloadDSL to represent methods with payloads, and renames the existing WithoutResultDSL to WithoutPayloadResultDSL to accurately reflect that it tests methods without both payload and result. The changes ensure the generated test code correctly handles the NewTestData() initialization based on whether methods have payloads.

Key changes:

  • Added WithPayloadDSL test case for methods with payloads
  • Renamed WithoutResultDSL to WithoutPayloadResultDSL for clarity
  • Added HasPayloads flag to control NewTestData() generation in templates

Reviewed Changes

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

Show a summary per file
File Description
testing/codegen/testdata/dsls.go Adds WithPayloadDSL test case and renames WithoutResultDSL to WithoutPayloadResultDSL
testing/codegen/testdata/code.go Adds expected code generation for payload scenarios and updates naming for without-payload-result case
testing/codegen/templates/suite_test.go.tpl Conditionally generates NewTestData() only when HasPayloads is true
testing/codegen/suite.go Adds HasPayloads field to suite data structure
testing/codegen/suite_test.go Updates test cases with new naming and adds with-payload test case
testing/codegen/scenarios_test.go Updates test cases with new naming and adds with-payload scenario
testing/codegen/harness.go Implements hasPayloads() helper function
testing/codegen/clients_test.go Updates test cases with new naming and adds with-payload client test
Comments suppressed due to low confidence (1)

testing/codegen/testdata/code.go:1

  • The line declaring td variable has been removed but it's still used on line 1289 (td.ValidWithResultMethodResult()). This will cause a compilation error unless td is defined elsewhere in the full file.
package testdata

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@raphael
Copy link
Member

raphael commented Oct 30, 2025

This is great, thank you!

@raphael raphael merged commit 272743b into v3 Oct 30, 2025
5 checks passed
@raphael raphael deleted the testing-suite-test-without-payload-result-2 branch October 30, 2025 19:31
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