Skip to content

[Feature Request] support tolerance in yaml rest test #18213

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

Open
bowenlan-amzn opened this issue May 6, 2025 · 3 comments · May be fixed by #18436
Open

[Feature Request] support tolerance in yaml rest test #18213

bowenlan-amzn opened this issue May 6, 2025 · 3 comments · May be fixed by #18436
Assignees
Labels
enhancement Enhancement or improvement to existing feature or request good first issue Good for newcomers Other

Comments

@bowenlan-amzn
Copy link
Member

bowenlan-amzn commented May 6, 2025

Is your feature request related to a problem? Please describe

It would be better if we can support tolerance/delta when matching a value in yaml rest test

For example, to add a delta on this match

  • match: {aggregations.mfs.fields.2.correlation.val2: 0.9569513137793205}

I need to write in this way

  • gte: {aggregations.mfs.fields.2.correlation.val2: 0.956951313779319}
  • lte: {aggregations.mfs.fields.2.correlation.val2: 0.956951313779321}

4a92aa4

Describe the solution you'd like

I see JUnit provides this assertEquals(double expected, double actual, double delta), so we probably can do similar thing in yaml rest test

  • match: {<matching_field>: <match_value>, epsilon: <delta_value>}

In my previous example, this will be

  • match: {aggregations.mfs.fields.2.correlation.val2: 0.9569513137793205, epsilon: 0.000000000000001}

This syntax is better to understand the real intention.
Related class to enhance is MatchAssertion.java

Related component

Other

Describe alternatives you've considered

No response

Additional context

No response

@bowenlan-amzn bowenlan-amzn added enhancement Enhancement or improvement to existing feature or request untriaged labels May 6, 2025
@github-actions github-actions bot added the Other label May 6, 2025
@bowenlan-amzn bowenlan-amzn added the good first issue Good for newcomers label May 7, 2025
@saketh-pallempati
Copy link

Hi @bowenlan-amzn
I would like to work on this issue. Will submit a PR soon.

@krisfreedain
Copy link
Member

Catch All Triage - 1 2

@saketh-pallempati
Copy link

Hi @bowenlan-amzn
I opened a PR for this issue
Please do review

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
Projects
None yet
3 participants