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
单测:将gomonkey替换为xgo #305
base: master
Are you sure you want to change the base?
单测:将gomonkey替换为xgo #305
Conversation
WalkthroughThis update signifies a shift in the testing framework used within the codebase, transitioning from Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
感谢您提出Pull Request,我会尽快Review。我会在1-2日内进行查看或者回复,如果遇到节假日可能会处理较慢,敬请谅解。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Status
Configuration used: CodeRabbit UI
Files ignored due to path filters (2)
go.mod
is excluded by!**/*.mod
go.sum
is excluded by!**/*.sum
Files selected for processing (1)
- client_test.go (4 hunks)
Additional comments not posted (3)
client_test.go (3)
28-28
: The change in the import statement fromgomonkey
toxgo
aligns with the PR's objectives and leveragesxgo
's benefits.
360-360
: The modification to usemock.Patch
for mocking inTestGetConfigAndInitValNotNil
effectively leveragesxgo
's capabilities.
379-379
: The modification to usemock.Patch
for mocking inTestGetConfigAndInitValNil
effectively leveragesxgo
's capabilities.
在这个PR中, 我使用xgo替换了gomonkey。
xgo相对于gomonkey具有如下优点:
defer patch.Reset()
等代码xgo的项目地址: https://github.com/xhd2015/xgo
使用xgo进行单测的步骤:
xgo test ./...
测试结果:
Summary by CodeRabbit