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: add test for protocol http1 #804

Merged
merged 5 commits into from
Jul 18, 2023

Conversation

a631807682
Copy link
Member

@a631807682 a631807682 commented Jun 3, 2023

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.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo.

(Optional) Translate the PR title into Chinese.

添加 pkg/protocol/http1 单测

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

en: Supplement unit test for pkg/protocol/http1, coverage increased from 53.30% to 81.9%.
zh(optional): 补充 pkg/protocol/http1 的单元测试,覆盖率从 53.30% 提高到了 81.9%。

其他疑问:
zr 已经 release,并且没有别的引用 https://github.com/cloudwego/hertz/blob/develop/pkg/protocol/http1/server.go#L328-L332
这里再判断一遍是必要的吗?https://github.com/cloudwego/hertz/blob/develop/pkg/protocol/http1/server.go#L353-L356

(Optional) Which issue(s) this PR fixes:

related to #257

(Optional) The PR that updates user documentation:

@a631807682 a631807682 requested review from a team as code owners June 3, 2023 05:40
@li-jin-gou
Copy link
Member

thanks💖

@codecov
Copy link

codecov bot commented Jun 3, 2023

Codecov Report

Patch coverage: 90.90% and project coverage change: +3.96 🎉

Comparison is base (2bd70be) 75.87% compared to head (70c8509) 79.84%.

❗ Current head 70c8509 differs from pull request most recent head 5f6c06a. Consider uploading reports for the commit 5f6c06a to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #804      +/-   ##
===========================================
+ Coverage    75.87%   79.84%   +3.96%     
===========================================
  Files           97       97              
  Lines         9512     9534      +22     
===========================================
+ Hits          7217     7612     +395     
+ Misses        1846     1423     -423     
- Partials       449      499      +50     
Impacted Files Coverage Δ
pkg/common/test/mock/body_data.go 92.00% <90.00%> (-8.00%) ⬇️
pkg/common/test/mock/network.go 86.02% <100.00%> (+0.20%) ⬆️

... and 9 files with indirect coverage changes

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

@Duslia
Copy link
Member

Duslia commented Jun 14, 2023

It seems that it's useless

welkeyever
welkeyever previously approved these changes Jun 16, 2023
Copy link
Member

@welkeyever welkeyever left a comment

Choose a reason for hiding this comment

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

Thanks a lot! LGTM

@welkeyever
Copy link
Member

As for the "duplicated code" you may trigger another pr for it~

@a631807682
Copy link
Member Author

As for the "duplicated code" you may trigger another pr for it~

I will create another PR for it

@li-jin-gou
Copy link
Member

@a631807682 There's a conflict that needs to be resolved.

@a631807682
Copy link
Member Author

@a631807682 There's a conflict that needs to be resolved.

done

@welkeyever welkeyever merged commit 7d25d5a into cloudwego:develop Jul 18, 2023
13 checks passed
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