Skip to content
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

Merged
merged 5 commits into from
Jan 6, 2023

Conversation

qreshi
Copy link
Contributor

@qreshi qreshi commented Jan 5, 2023

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

  • Commits are signed per the DCO using --signoff

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.

@qreshi qreshi requested a review from a team January 5, 2023 23:41
@codecov-commenter
Copy link

codecov-commenter commented Jan 5, 2023

Codecov Report

Merging #590 (6c81a4c) into main (5b9ff98) will not change coverage.
The diff coverage is n/a.

@@            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           
Flag Coverage Δ
opensearch-notifications 61.36% <ø> (ø)

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.

@qreshi qreshi merged commit 62b8c36 into opensearch-project:main Jan 6, 2023
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.0 failed:

The process '/usr/bin/git' failed with exit code 1

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 base branch is 2.0 and the compare/head branch is backport/backport-590-to-2.0.

opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 6, 2023
…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)
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.1 failed:

The process '/usr/bin/git' failed with exit code 1

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 base branch is 2.1 and the compare/head branch is backport/backport-590-to-2.1.

opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 6, 2023
…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)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 6, 2023
…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)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 6, 2023
…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)
qreshi added a commit that referenced this pull request Jan 6, 2023
…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]>
qreshi added a commit that referenced this pull request Jan 6, 2023
…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]>
qreshi added a commit that referenced this pull request Jan 6, 2023
…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]>
qreshi added a commit that referenced this pull request Jan 6, 2023
…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]>
@qreshi qreshi mentioned this pull request Jan 11, 2023
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants