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

test: ut supplementary for pkg/network #271

Merged
merged 1 commit into from Sep 29, 2022

Conversation

BaiZe1998
Copy link
Contributor

@BaiZe1998 BaiZe1998 commented Sep 24, 2022

What type of PR is this?

test

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.

Translate the PR title into Chinese.

pkg/network补充单元测试

More detail description for this PR(en: English/zh: Chinese).

en:
unit tests coverage improvement:
pkg/network/dialer:0% -> 100%
pkg/network/netpoll:0% -> 33.8%
pkg/network/standard:46.2% -> 75.2%

ps. Unit tests for pkg/network/standard/dialer.go, pkg/network/standard/transport.go, pkg/network/netpoll/dialer.go, pkg/network/netpoll/transport.go are not supplemented due to circular references. Comments with solutions welcome.

zh:
单测覆盖率提升:
pkg/network/dialer:0% -> 100%
pkg/network/netpoll:0% -> 33.8%
pkg/network/standard:46.2% -> 75.2%

ps. 由于循环引用导致 pkg/network/standard/dialer.go, pkg/network/standard/transport.go, pkg/network/netpoll/dialer.go, pkg/network/netpoll/transport.go 的单测未能补充,如有建议欢迎评论。

具体细节:由于上述文件分别位于network/standardnetwork/netpoll包当中,在模拟构造网络请求的时候,使用到了route包的Engine,而route包import了network/standardnetwork/netpoll

Which issue(s) this PR fixes:

@li-jin-gou
Copy link
Member

li-jin-gou commented Sep 24, 2022

  • 可以补充一下循环依赖的具体细节,这样可以和大家可以做出一些评论 @BaiZe1998
  • 修复CI

@li-jin-gou li-jin-gou changed the title test: ut supplementary for pkg/network (wip)test: ut supplementary for pkg/network Sep 24, 2022
@BaiZe1998
Copy link
Contributor Author

  • 可以补充一下循环依赖的具体细节,这样可以和大家可以做出一些评论 @BaiZe1998
  • 修复CI

已经在pr中描述了循环依赖出现的场景

@li-jin-gou li-jin-gou closed this Sep 24, 2022
@li-jin-gou li-jin-gou reopened this Sep 24, 2022
@li-jin-gou
Copy link
Member

li-jin-gou commented Sep 24, 2022

  • 可以补充一下循环依赖的具体细节,这样可以和大家可以做出一些评论 @BaiZe1998
  • 修复CI

已经在pr中描述了循环依赖出现的场景

CI没有通过,可以修复一下.

@BaiZe1998 BaiZe1998 force-pushed the ut_network branch 2 times, most recently from 7e54e85 to 03baf95 Compare September 25, 2022 01:35
@codecov
Copy link

codecov bot commented Sep 25, 2022

Codecov Report

Base: 59.27% // Head: 60.30% // Increases project coverage by +1.03% 🎉

Coverage data is based on head (39c951c) compared to base (ac34fef).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head 39c951c differs from pull request most recent head 88d6325. Consider uploading reports for the commit 88d6325 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #271      +/-   ##
===========================================
+ Coverage    59.27%   60.30%   +1.03%     
===========================================
  Files           79       84       +5     
  Lines         8150     8266     +116     
===========================================
+ Hits          4831     4985     +154     
+ Misses        2966     2928      -38     
  Partials       353      353              
Impacted Files Coverage Δ
pkg/app/server/option.go 89.91% <100.00%> (+0.35%) ⬆️
pkg/common/config/option.go 100.00% <100.00%> (+100.00%) ⬆️
pkg/route/engine.go 62.06% <100.00%> (+0.08%) ⬆️
pkg/network/netpoll/dial.go 0.00% <0.00%> (ø)
pkg/network/netpoll/transport.go 0.00% <0.00%> (ø)
pkg/network/dialer/default.go 100.00% <0.00%> (ø)
pkg/network/dialer/dialer.go 100.00% <0.00%> (ø)
pkg/network/netpoll/connection.go 94.28% <0.00%> (ø)
pkg/network/standard/buffer.go 94.73% <0.00%> (+13.15%) ⬆️
pkg/network/standard/connection.go 82.72% <0.00%> (+14.95%) ⬆️
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@li-jin-gou li-jin-gou changed the title (wip)test: ut supplementary for pkg/network test: ut supplementary for pkg/network Sep 25, 2022
@BaiZe1998
Copy link
Contributor Author

  • 可以补充一下循环依赖的具体细节,这样可以和大家可以做出一些评论 @BaiZe1998
  • 修复CI

已经在pr中描述了循环依赖出现的场景

CI没有通过,可以修复一下.

已修复

test: ut supplementary for pkg/network
@li-jin-gou
Copy link
Member

LGTM

@li-jin-gou li-jin-gou merged commit aac9abc into cloudwego:develop Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants