Skip to content

Fix ScenarioRunner using methods without result generated by testing/codegen#214

Merged
raphael merged 4 commits into
v3from
testing-scenario-runner-without-result
Oct 16, 2025
Merged

Fix ScenarioRunner using methods without result generated by testing/codegen#214
raphael merged 4 commits into
v3from
testing-scenario-runner-without-result

Conversation

@tchssk
Copy link
Copy Markdown
Member

@tchssk tchssk commented Oct 14, 2025

No description provided.

@tchssk tchssk marked this pull request as ready for review October 14, 2025 16:02
@tchssk tchssk requested a review from Copilot October 15, 2025 00:28
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 fixes an issue in the ScenarioRunner's method execution template where it was incorrectly handling methods without results. The fix ensures that methods without return values properly return nil as the first return value to match the expected (any, error) signature of the executeMethod function.

  • Corrected the template to handle both methods with and without results uniformly
  • Added comprehensive test coverage for scenario generation with both result types
  • Renamed variables for better clarity between client methods and scenario runner code

Reviewed Changes

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

File Description
testing/codegen/testdata/code.go Renamed variables and added comprehensive test data for scenario runner code generation
testing/codegen/templates/scenario_runner.go.tpl Fixed template to properly handle methods without results by returning nil as first value
testing/codegen/scenarios_test.go Added new test file to verify scenario generation for both result and non-result methods
testing/codegen/clients_test.go Updated variable references to match renamed test data constants

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

@raphael
Copy link
Copy Markdown
Member

raphael commented Oct 16, 2025

This is great, thank you!

@raphael raphael merged commit 11a756c into v3 Oct 16, 2025
5 checks passed
@raphael raphael deleted the testing-scenario-runner-without-result branch October 16, 2025 05:13
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