feat: Add epsilon tolerance for numeric matches in YAML REST tests#18436
feat: Add epsilon tolerance for numeric matches in YAML REST tests#18436saketh-pallempati wants to merge 4 commits into
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 <pallempati.saketh@fmr.com>
|
❌ 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 <saketh.pallempati@gmail.com>
Signed-off-by: Saketh Pallempati <saketh.pallempati@gmail.com>
|
❌ 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.
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.
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 <saketh.pallempati@gmail.com>
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.