-
Notifications
You must be signed in to change notification settings - Fork 66
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
Add index refresh after config creation and deletion in integration tests #590
Conversation
Signed-off-by: Mohammad Qureshi <[email protected]>
Signed-off-by: Mohammad Qureshi <[email protected]>
…refresh Signed-off-by: Mohammad Qureshi <[email protected]>
…t refreshes indices Signed-off-by: Mohammad Qureshi <[email protected]>
e8c6ae7
to
4d5f930
Compare
Codecov Report
@@ Coverage Diff @@
## main #590 +/- ##
=========================================
Coverage 61.36% 61.36%
Complexity 112 112
=========================================
Files 73 73
Lines 2472 2472
Branches 265 265
=========================================
Hits 1517 1517
Misses 778 778
Partials 177 177
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
…ssertion Signed-off-by: Mohammad Qureshi <[email protected]>
notifications/notifications/src/test/kotlin/org/opensearch/integtest/PluginRestTestCase.kt
Show resolved
Hide resolved
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.0 2.0
# Navigate to the new working tree
cd .worktrees/backport-2.0
# Create a new branch
git switch --create backport/backport-590-to-2.0
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 62b8c360406201f23fb719a3a206e825447a2280
# Push it to GitHub
git push --set-upstream origin backport/backport-590-to-2.0
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.0 Then, create a pull request where the |
…ests (#590) * Add refresh to config creation in tests Signed-off-by: Mohammad Qureshi <[email protected]> * Remove duplicate createConfig utility methods for tests Signed-off-by: Mohammad Qureshi <[email protected]> * Replace delete config calls in tests with helper method with indices refresh Signed-off-by: Mohammad Qureshi <[email protected]> * Replace creating config from JSON string calls with helper method that refreshes indices Signed-off-by: Mohammad Qureshi <[email protected]> * Update security test back to correct request with expected response assertion Signed-off-by: Mohammad Qureshi <[email protected]> Signed-off-by: Mohammad Qureshi <[email protected]> (cherry picked from commit 62b8c36)
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.1 2.1
# Navigate to the new working tree
cd .worktrees/backport-2.1
# Create a new branch
git switch --create backport/backport-590-to-2.1
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 62b8c360406201f23fb719a3a206e825447a2280
# Push it to GitHub
git push --set-upstream origin backport/backport-590-to-2.1
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.1 Then, create a pull request where the |
…ests (#590) * Add refresh to config creation in tests Signed-off-by: Mohammad Qureshi <[email protected]> * Remove duplicate createConfig utility methods for tests Signed-off-by: Mohammad Qureshi <[email protected]> * Replace delete config calls in tests with helper method with indices refresh Signed-off-by: Mohammad Qureshi <[email protected]> * Replace creating config from JSON string calls with helper method that refreshes indices Signed-off-by: Mohammad Qureshi <[email protected]> * Update security test back to correct request with expected response assertion Signed-off-by: Mohammad Qureshi <[email protected]> Signed-off-by: Mohammad Qureshi <[email protected]> (cherry picked from commit 62b8c36)
…ests (#590) * Add refresh to config creation in tests Signed-off-by: Mohammad Qureshi <[email protected]> * Remove duplicate createConfig utility methods for tests Signed-off-by: Mohammad Qureshi <[email protected]> * Replace delete config calls in tests with helper method with indices refresh Signed-off-by: Mohammad Qureshi <[email protected]> * Replace creating config from JSON string calls with helper method that refreshes indices Signed-off-by: Mohammad Qureshi <[email protected]> * Update security test back to correct request with expected response assertion Signed-off-by: Mohammad Qureshi <[email protected]> Signed-off-by: Mohammad Qureshi <[email protected]> (cherry picked from commit 62b8c36)
…ests (#590) * Add refresh to config creation in tests Signed-off-by: Mohammad Qureshi <[email protected]> * Remove duplicate createConfig utility methods for tests Signed-off-by: Mohammad Qureshi <[email protected]> * Replace delete config calls in tests with helper method with indices refresh Signed-off-by: Mohammad Qureshi <[email protected]> * Replace creating config from JSON string calls with helper method that refreshes indices Signed-off-by: Mohammad Qureshi <[email protected]> * Update security test back to correct request with expected response assertion Signed-off-by: Mohammad Qureshi <[email protected]> Signed-off-by: Mohammad Qureshi <[email protected]> (cherry picked from commit 62b8c36)
…ests (#590) (#592) * Add refresh to config creation in tests Signed-off-by: Mohammad Qureshi <[email protected]> * Remove duplicate createConfig utility methods for tests Signed-off-by: Mohammad Qureshi <[email protected]> * Replace delete config calls in tests with helper method with indices refresh Signed-off-by: Mohammad Qureshi <[email protected]> * Replace creating config from JSON string calls with helper method that refreshes indices Signed-off-by: Mohammad Qureshi <[email protected]> * Update security test back to correct request with expected response assertion Signed-off-by: Mohammad Qureshi <[email protected]> Signed-off-by: Mohammad Qureshi <[email protected]> (cherry picked from commit 62b8c36) Co-authored-by: Mohammad Qureshi <[email protected]>
…ests (#590) (#595) * Add refresh to config creation in tests Signed-off-by: Mohammad Qureshi <[email protected]> * Remove duplicate createConfig utility methods for tests Signed-off-by: Mohammad Qureshi <[email protected]> * Replace delete config calls in tests with helper method with indices refresh Signed-off-by: Mohammad Qureshi <[email protected]> * Replace creating config from JSON string calls with helper method that refreshes indices Signed-off-by: Mohammad Qureshi <[email protected]> * Update security test back to correct request with expected response assertion Signed-off-by: Mohammad Qureshi <[email protected]> Signed-off-by: Mohammad Qureshi <[email protected]> (cherry picked from commit 62b8c36) Co-authored-by: Mohammad Qureshi <[email protected]>
…ests (#590) (#594) * Add refresh to config creation in tests Signed-off-by: Mohammad Qureshi <[email protected]> * Remove duplicate createConfig utility methods for tests Signed-off-by: Mohammad Qureshi <[email protected]> * Replace delete config calls in tests with helper method with indices refresh Signed-off-by: Mohammad Qureshi <[email protected]> * Replace creating config from JSON string calls with helper method that refreshes indices Signed-off-by: Mohammad Qureshi <[email protected]> * Update security test back to correct request with expected response assertion Signed-off-by: Mohammad Qureshi <[email protected]> Signed-off-by: Mohammad Qureshi <[email protected]> (cherry picked from commit 62b8c36) Co-authored-by: Mohammad Qureshi <[email protected]>
…ests (#590) (#593) * Add refresh to config creation in tests Signed-off-by: Mohammad Qureshi <[email protected]> * Remove duplicate createConfig utility methods for tests Signed-off-by: Mohammad Qureshi <[email protected]> * Replace delete config calls in tests with helper method with indices refresh Signed-off-by: Mohammad Qureshi <[email protected]> * Replace creating config from JSON string calls with helper method that refreshes indices Signed-off-by: Mohammad Qureshi <[email protected]> * Update security test back to correct request with expected response assertion Signed-off-by: Mohammad Qureshi <[email protected]> Signed-off-by: Mohammad Qureshi <[email protected]> (cherry picked from commit 62b8c36) Co-authored-by: Mohammad Qureshi <[email protected]>
Description
Refactor the calls to Notification config creation and deletion in the integration tests by using helper methods that contain calls to refresh all indices after the config create/delete calls. This is to ensure that the searchable state of the Notification config index is as expected so the assertion calls pass (to avoid flaky failures).
When #381 is added, these helper methods can be updated to have the refresh policy within the REST call itself. The refactoring of the tests makes it easier to make that change later on.
Issues Resolved
[List any issues this PR will resolve]
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.