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

Move REST API tests into integration tests (Part 1) #4153

Merged

Conversation

willyborankin
Copy link
Collaborator

@willyborankin willyborankin commented Mar 21, 2024

Description

REST API tests refactoring. First part of moving REST API tests into integrationTests.

Added test:

  • DefaultApiAvailabilityIntegrationTest
    Moved tests:
  • FlushCacheApiTest part of DefaultApiAvailabilityIntegrationTest
  • AccountApiTest as AccountRestApiIntegrationTest

Tests with the Legacy prefix removed since new tests use randomization for paths

Testing

[Please provide details of testing done: unit testing, integration testing and manual testing]

Check List

  • New functionality includes testing
  • New functionality has been documented
  • 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.

@willyborankin willyborankin force-pushed the refactor-tests branch 2 times, most recently from bbdfd76 to d194185 Compare March 21, 2024 21:07
@willyborankin willyborankin mentioned this pull request Mar 26, 2024
3 tasks
willyborankin added a commit to willyborankin/security that referenced this pull request Mar 26, 2024
- Added hidden/reserved fields for TestSecurityConfig.User, TestSecurityConfig.Role
- Moved RolesMapping class into TestSecurityConfig
- Added ActionGroup class in TestSecurityConfig
- LocalOpenSearchCluster now always delete config folders when any test is over
- Added bodyAsJsonNode in the HttpResponse class

Signed-off-by: Andrey Pleskach <[email protected]>
@willyborankin willyborankin force-pushed the refactor-tests branch 2 times, most recently from e9ca7ad to 78be229 Compare March 28, 2024 11:28
Copy link

codecov bot commented Mar 28, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 66.04%. Comparing base (a5a5e03) to head (ec26a2f).
Report is 7 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4153      +/-   ##
==========================================
- Coverage   66.15%   66.04%   -0.12%     
==========================================
  Files         301      301              
  Lines       21708    21709       +1     
  Branches     3506     3506              
==========================================
- Hits        14362    14337      -25     
- Misses       5584     5610      +26     
  Partials     1762     1762              
Files Coverage Δ
...g/opensearch/security/securityconf/impl/CType.java 97.05% <0.00%> (-2.95%) ⬇️

... and 5 files with indirect coverage changes

@willyborankin willyborankin force-pushed the refactor-tests branch 2 times, most recently from 098e9f7 to e79c158 Compare March 28, 2024 20:50
@willyborankin willyborankin changed the title [WIP] Moved REST API tests into integration tests Move REST API tests into integration tests (Part 1) Apr 7, 2024
@willyborankin willyborankin marked this pull request as ready for review April 7, 2024 14:52
@willyborankin willyborankin force-pushed the refactor-tests branch 2 times, most recently from 9b87bae to 2fdaf28 Compare April 7, 2024 19:27
Copy link
Contributor

@stephen-crawford stephen-crawford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me. Thanks @willyborankin

@willyborankin
Copy link
Collaborator Author

Hi, @scrawfor99 than you for the review. I addressed your comments

@willyborankin willyborankin force-pushed the refactor-tests branch 4 times, most recently from 10ee660 to cec6278 Compare April 9, 2024 13:10
peternied
peternied previously approved these changes Apr 12, 2024
Copy link
Member

@peternied peternied left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets get this merged, make follow up PRs if desired

cwperks
cwperks previously approved these changes Apr 12, 2024
Added test:
 - DefaultApiAvailabilityIntegrationTest
Moved tests:
 - FlushCacheApiTest part of DefaultApiAvailabilityIntegrationTest
 - AccountApiTest as AccountRestApiIntegrationTest

Tests with the Legacy prefix removed since new tests use randomization for paths

Signed-off-by: Andrey Pleskach <[email protected]>
@cwperks cwperks added the backport 2.x backport to 2.x branch label Apr 15, 2024
@stephen-crawford stephen-crawford merged commit a6b04ae into opensearch-project:main Apr 15, 2024
80 of 83 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

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

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/security/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/security/backport-2.x
# Create a new branch
git switch --create backport/backport-4153-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a6b04ae751c5233aeaf50ff63a918fccb58caa31
# Push it to GitHub
git push --set-upstream origin backport/backport-4153-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-4153-to-2.x.

willyborankin added a commit to willyborankin/security that referenced this pull request Apr 29, 2024
dlin2028 pushed a commit to dlin2028/security that referenced this pull request May 1, 2024
cwperks pushed a commit that referenced this pull request May 6, 2024
@willyborankin willyborankin deleted the refactor-tests branch June 14, 2024 19:00
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants