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

update easyMock to mock in chime test #815

Merged
merged 3 commits into from
Nov 17, 2023

Conversation

rohan19a
Copy link
Contributor

@rohan19a rohan19a commented Nov 15, 2023

Description

Updated a chime webhook test from easyMock to Mockk

Issues Resolved

#237

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.

Signed-off-by: rohan19a <[email protected]>
@Hailong-am
Copy link
Collaborator

@rohan19a ktlint check has failed. can you run ./gradlew ktlintFormat to fix it?

@yuye-aws
Copy link
Member

Some tests get failed. Please take a look at why.

Signed-off-by: rohan19a <[email protected]>
Copy link

codecov bot commented Nov 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (62b7b4f) 66.85% compared to head (ec6a557) 66.85%.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #815   +/-   ##
=========================================
  Coverage     66.85%   66.85%           
  Complexity      263      263           
=========================================
  Files            39       39           
  Lines          1738     1738           
  Branches        165      165           
=========================================
  Hits           1162     1162           
  Misses          453      453           
  Partials        123      123           
Flag Coverage Δ
opensearch-notifications 66.85% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Hailong-am
Hailong-am previously approved these changes Nov 16, 2023
Copy link
Collaborator

@Hailong-am Hailong-am left a comment

Choose a reason for hiding this comment

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

LGTM

@zhichao-aws
Copy link
Member

Can we replace the EasyMock with mockk in this test case also? Then we can remove the dependency for EasyMock in ChimeDestinationTests

@rohan19a
Copy link
Contributor Author

Can we replace the EasyMock with mockk in this test case also? Then we can remove the dependency for EasyMock in ChimeDestinationTests

Missed that somehow, I'll edit that and recommit

Copy link
Member

@zhichao-aws zhichao-aws left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Collaborator

@Hailong-am Hailong-am left a comment

Choose a reason for hiding this comment

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

Looks good to me, we have serval files still using easyMock, we can have follow up PR to remove them all, after that we can remove the dependency of easyMock

@Hailong-am Hailong-am merged commit 09d1c03 into opensearch-project:main Nov 17, 2023
14 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/notifications/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/notifications/backport-2.x
# Create a new branch
git switch --create backport/backport-815-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 09d1c03a2411c057bc73543562cc166cb0944c8d
# Push it to GitHub
git push --set-upstream origin backport/backport-815-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/notifications/backport-2.x

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

@yuye-aws
Copy link
Member

Shall we manually backport this PR to 2.x branch?

@Hailong-am
Copy link
Collaborator

@rohan19a would you mind to do manual backport according to #815 (comment)

@zhichao-aws
Copy link
Member

In main branch we use mockk to create a CloseableHttpResponse instance, while in 2.x we still used EasyMock, and the code inconsistence causes the backport fail. We need to manual backport and replace all EasyMock usage in the backport PR.

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