Skip to content

Conversation

@saketh-pallempati
Copy link

@saketh-pallempati saketh-pallempati commented Jun 4, 2025

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

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

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]>
@saketh-pallempati saketh-pallempati requested a review from a team as a code owner June 4, 2025 05:43
@github-actions github-actions bot added enhancement Enhancement or improvement to existing feature or request good first issue Good for newcomers Other labels Jun 4, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2025

❌ 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?

@opensearch-trigger-bot
Copy link
Contributor

This PR is stalled because it has been open for 30 days with no activity.

@opensearch-trigger-bot opensearch-trigger-bot bot added the stalled Issues that have stalled label Jul 4, 2025
@bowenlan-amzn
Copy link
Member

Sorry for the delay. Has been really busy last 2 months.
I see :test:framework:spotlessJavaCheck FAILED in https://build.ci.opensearch.org/job/gradle-check/58744/console

can run ./gradlew :test:framework:spotlessApply once

@opensearch-trigger-bot opensearch-trigger-bot bot removed the stalled Issues that have stalled label Aug 8, 2025
Signed-off-by: Saketh Pallempati <[email protected]>
Signed-off-by: Saketh Pallempati <[email protected]>
@github-actions
Copy link
Contributor

❌ 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?

@bowenlan-amzn
Copy link
Member

Maybe try merge with main once

Copy link
Member

@bowenlan-amzn bowenlan-amzn left a 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

Image

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);
Copy link
Member

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.

@saketh-pallempati
Copy link
Author

Thanks for all the inputs @bowenlan-amzn. I will try to figure it out.

- 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]>
@github-actions
Copy link
Contributor

❌ 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?

@opensearch-trigger-bot
Copy link
Contributor

This PR is stalled because it has been open for 30 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement or improvement to existing feature or request good first issue Good for newcomers Other stalled Issues that have stalled

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] support tolerance in yaml rest test

2 participants