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

Refactoring Metadata Unit Tests #15089

Open
wants to merge 1 commit into
base: 3.3
Choose a base branch
from

Conversation

heliang666s
Copy link
Contributor

What is the purpose of the change?

Refactoring Metadata Unit Tests

Checklist

  • Make sure there is a GitHub_issue field for the change.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Make sure gitHub actions can pass. Why the workflow is failing and how to fix it?

@codecov-commenter
Copy link

codecov-commenter commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.75%. Comparing base (628dcbf) to head (63980a4).

Additional details and impacted files
@@             Coverage Diff              @@
##                3.3   #15089      +/-   ##
============================================
- Coverage     60.76%   60.75%   -0.02%     
- Complexity    10863    10864       +1     
============================================
  Files          1882     1882              
  Lines         86007    86007              
  Branches      12886    12886              
============================================
- Hits          52263    52253      -10     
- Misses        28301    28308       +7     
- Partials       5443     5446       +3     
Flag Coverage Δ
integration-tests 33.13% <ø> (+0.15%) ⬆️
samples-tests 29.21% <ø> (-0.01%) ⬇️
unit-tests 58.91% <ø> (-0.02%) ⬇️

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.

* Uses Map<String, String> to simulate ZK node storage:
* key corresponds to the ZK node path, and value corresponds to the node content.
*/
private final Map<String, String> zkDataStore = new ConcurrentHashMap<>();
Copy link
Member

Choose a reason for hiding this comment

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

Now that we've mocked ZookeeperClient, I think we can simulate the return result directly without actually storing it and spread the setUp logic across each unit test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants