Skip to content

Fix allowed_warnings takes no effect for the yaml test in 75_update.yml#16764

Merged
reta merged 1 commit intoopensearch-project:mainfrom
gaobinlong:optimize_test
Dec 3, 2024
Merged

Fix allowed_warnings takes no effect for the yaml test in 75_update.yml#16764
reta merged 1 commit intoopensearch-project:mainfrom
gaobinlong:optimize_test

Conversation

@gaobinlong
Copy link
Copy Markdown
Contributor

@gaobinlong gaobinlong commented Dec 3, 2024

Description

In this PR, we have some yaml tests to verify that the update API can return deprecation warning header under some condition, but by accident, I found that the allowed_warnings command in the second test case in 75_update.yml takes no effect, change the warning message to a random string and even remove the allowed_warnings, the test case still passes, after diving deep into this, I found the reason is that we only log the deprecation log and return the warning header once for every single X-Opaque-Id, both the first update request and second update request in the yaml test file have empty X-Opaque-Id header, so the second update request receives no warning header.

This PR fixes this test bug by specifying different X-Opaque-Id header for the two update requests and changing the allowed_warning command to warnings which can verify that the API request really returns warning header.

Related Issues

No issue.

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.

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 3, 2024

✅ Gradle check result for b927c72: SUCCESS

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.01%. Comparing base (d2a1477) to head (b927c72).
Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #16764      +/-   ##
============================================
- Coverage     72.16%   72.01%   -0.16%     
+ Complexity    65257    65163      -94     
============================================
  Files          5318     5318              
  Lines        303988   303988              
  Branches      43987    43987              
============================================
- Hits         219358   218902     -456     
- Misses        66674    67151     +477     
+ Partials      17956    17935      -21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@reta reta merged commit d6157d6 into opensearch-project:main Dec 3, 2024
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 3, 2024
…ml (#16764)

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
(cherry picked from commit d6157d6)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
reta pushed a commit that referenced this pull request Dec 3, 2024
…ml (#16764) (#16766)

(cherry picked from commit d6157d6)

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
akolarkunnu pushed a commit to akolarkunnu/OpenSearch that referenced this pull request Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.x Backport to 2.x branch skip-changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants