-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat: Add epsilon tolerance for numeric matches in YAML REST tests #18436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: Add epsilon tolerance for numeric matches in YAML REST tests #18436
Conversation
This commit introduces an epsilon parameter to the match assertion in YAML REST tests. This allows for specifying a tolerance when comparing numerical values Signed-off-by: Pallempati Saketh <[email protected]>
|
❌ Gradle check result for 46be2f6: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
This PR is stalled because it has been open for 30 days with no activity. |
|
Sorry for the delay. Has been really busy last 2 months. can run |
Signed-off-by: Saketh Pallempati <[email protected]>
Signed-off-by: Saketh Pallempati <[email protected]>
|
❌ Gradle check result for 6433e7d: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Maybe try merge with main once |
bowenlan-amzn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's how I debug using a yaml test
Run the test
./gradlew ':modules:aggs-matrix-stats:yamlRestTest' --tests "org.opensearch.search.aggregations.matrix.MatrixStatsClientYamlTestSuiteIT.test {yaml=stats/20_empty_bucket/*}" --debug-jvm
And attach a debugger
So I can stop at MatchAssertion parse and see what parser gives me there.
| } | ||
| } else { | ||
| // simple match: { field: value } | ||
| Tuple<String, Object> stringObjectTuple = ParserUtils.parseTuple(parser); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can try reuse parseTuple for the new logic. If parser.map() only have 1 item, it's the same. If the map contains 2, then one of it must be epsilon and the other is like before.
|
Thanks for all the inputs @bowenlan-amzn. I will try to figure it out. |
45e606c to
2aaf8b4
Compare
- Add parseFields method to ParserUtils for handling 1-2 field objects - Simplify MatchAssertion parsing logic to use unified approach - Add epsilon support for floating-point comparisons - Add comprehensive tests for epsilon functionality Signed-off-by: Saketh Pallempati <[email protected]>
2aaf8b4 to
cff6a90
Compare
|
❌ Gradle check result for cff6a90: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
This PR is stalled because it has been open for 30 days with no activity. |
Description
This commit introduces an epsilon parameter to the match assertion in YAML REST tests. This allows for specifying a tolerance when comparing numerical values
Related Issues
Resolves #18213
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.