Support selecting an explicit method for apis in YAML specs.#141698
Merged
mosche merged 7 commits intoelastic:mainfrom Feb 6, 2026
Merged
Support selecting an explicit method for apis in YAML specs.#141698mosche merged 7 commits intoelastic:mainfrom
mosche merged 7 commits intoelastic:mainfrom
Conversation
If a specification defines multiple methods for an api, the client randomly picks one. This can lead to BWC test issues if some method is not available in earlier versions and requires to explicitly select the method to use.
Collaborator
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for explicitly specifying HTTP methods in YAML test specifications to address backward compatibility (BWC) test issues. When an API specification defines multiple HTTP methods, tests previously randomly selected one, which could cause failures if certain methods weren't available in earlier versions. This change allows test authors to explicitly specify which method to use.
Changes:
- Added a
methodparameter to API call infrastructure that propagates from YAML parsing through to HTTP request execution - Updated YAML parser to recognize and extract the
methodfield from test specifications - Added validation to ensure explicitly specified methods are supported by the target API
- Updated all YAML test client implementations to accept and forward the method parameter
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ApiCallSection.java | Added method field with getter/setter and copy support |
| DoSection.java | Updated parser to extract method parameter and pass it to ApiCallSection |
| DoSectionTests.java | Added test case for parsing explicit method specification |
| ClientYamlTestClient.java | Added method validation and selection logic with priority over random selection |
| ClientYamlTestExecutionContext.java | Added method parameter to callApi methods with proper overload chaining |
| ClientYamlTestExecutionContextTests.java | Updated test mocks to include method parameter |
| ImpersonateOfficialClientTestClient.java | Added method parameter forwarding in override |
| ClientYamlDocsTestClient.java | Added method parameter with proper variable naming to avoid conflicts with raw requests |
| CcsCommonYamlTestSuiteIT.java | Added method parameter to override signature |
| cat.count/10_basic.yml | Added explicit method: GET specifications to test cases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...on-rest/src/yamlRestTest/java/org/elasticsearch/test/rest/yaml/CcsCommonYamlTestSuiteIT.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
mamazzol
approved these changes
Feb 6, 2026
mosche
added a commit
to mosche/elasticsearch
that referenced
this pull request
Feb 6, 2026
…#141698) If a specification defines multiple methods for an api, the client randomly picks one. This can lead to BWC test issues if some method is not available in earlier versions and requires to explicitly select the method to use.
mosche
added a commit
to mosche/elasticsearch
that referenced
this pull request
Feb 6, 2026
…#141698) If a specification defines multiple methods for an api, the client randomly picks one. This can lead to BWC test issues if some method is not available in earlier versions and requires to explicitly select the method to use.
mosche
added a commit
to mosche/elasticsearch
that referenced
this pull request
Feb 6, 2026
…#141698) If a specification defines multiple methods for an api, the client randomly picks one. This can lead to BWC test issues if some method is not available in earlier versions and requires to explicitly select the method to use.
mosche
added a commit
to mosche/elasticsearch
that referenced
this pull request
Feb 6, 2026
…#141698) If a specification defines multiple methods for an api, the client randomly picks one. This can lead to BWC test issues if some method is not available in earlier versions and requires to explicitly select the method to use.
Collaborator
elasticsearchmachine
pushed a commit
that referenced
this pull request
Feb 6, 2026
#141999) If a specification defines multiple methods for an api, the client randomly picks one. This can lead to BWC test issues if some method is not available in earlier versions and requires to explicitly select the method to use.
elasticsearchmachine
pushed a commit
that referenced
this pull request
Feb 6, 2026
#142000) If a specification defines multiple methods for an api, the client randomly picks one. This can lead to BWC test issues if some method is not available in earlier versions and requires to explicitly select the method to use.
elasticsearchmachine
pushed a commit
that referenced
this pull request
Feb 6, 2026
#142002) If a specification defines multiple methods for an api, the client randomly picks one. This can lead to BWC test issues if some method is not available in earlier versions and requires to explicitly select the method to use.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a specification defines multiple methods for an api, the client randomly picks one. This can lead to BWC test issues if some method is not available in earlier versions and requires to explicitly select the method to use.
Relates to #140948