Skip to content

Sort transports generated by testing plugin#253

Merged
raphael merged 4 commits intov3from
testing-transports-sort
May 1, 2026
Merged

Sort transports generated by testing plugin#253
raphael merged 4 commits intov3from
testing-transports-sort

Conversation

@tchssk
Copy link
Copy Markdown
Member

@tchssk tchssk commented Apr 30, 2026

This pull request enhances the scenario-based testing code generation for services by improving how supported transports are handled and by adding comprehensive scenario type definitions for different service configurations. The changes increase maintainability and extensibility of the test code, especially around transport handling and scenario structure.

Enhancements to transport handling:

  • Refactored the way supported transports are collected and sorted for each method, using maps.Keys and slices.Sorted for clarity and correctness in buildScenariosData. [1] [2]

Expanded scenario type definitions for test code:

  • Added new scenario type code snippets (ScenarioTypesWithPayloadCode, ScenarioTypesWithResultCode, ScenarioTypesWithoutPayloadResultCode) that define the structure of scenarios, steps, expectations, and transport availability for each service configuration. These definitions are now included in the generated test code for services with payload, with result, and without payload/result. [1] [2] [3]
  • Updated the scenario test cases in scenarios_test.go to expect the new scenario type code snippets in the generated output, ensuring tests cover the new scenario structure.

@tchssk tchssk marked this pull request as ready for review April 30, 2026 16:27
@raphael
Copy link
Copy Markdown
Member

raphael commented Apr 30, 2026

This is great! Thanks for tightening up the generated scenario output and adding coverage for the scenario types. One small follow-up: buildScenariosData now sorts the per-method TransportAvailability, but ValidTransports is still populated from map iteration and is used by the example scenarios template. Could you sort that slice too so the example YAML is deterministic as well?

@raphael
Copy link
Copy Markdown
Member

raphael commented May 1, 2026

Thank you!

@raphael raphael merged commit 1a2973d into v3 May 1, 2026
5 checks passed
@raphael raphael deleted the testing-transports-sort branch May 1, 2026 19:22
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.

2 participants