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: enrich ut for Default in server/hertz.go #403

Closed
wants to merge 1 commit into from

Conversation

mamil
Copy link
Contributor

@mamil mamil commented Nov 21, 2022

What type of PR is this?

test: Adding missing tests or correcting existing tests

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.

(Optional) Translate the PR title into Chinese.

为server/hertz.go中的Default 方法添加单元测试

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

en:
zh(optional):

Which issue(s) this PR fixes:

null

@CLAassistant
Copy link

CLAassistant commented Nov 21, 2022

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Nov 21, 2022

Codecov Report

Base: 67.53% // Head: 67.50% // Decreases project coverage by -0.02% ⚠️

Coverage data is based on head (5eb8f16) compared to base (d601515).
Patch has no changes to coverable lines.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #403      +/-   ##
===========================================
- Coverage    67.53%   67.50%   -0.03%     
===========================================
  Files           89       89              
  Lines         8608     8608              
===========================================
- Hits          5813     5811       -2     
- Misses        2435     2438       +3     
+ Partials       360      359       -1     
Impacted Files Coverage Δ
pkg/common/timer/timer.go 61.90% <0.00%> (-19.05%) ⬇️
pkg/common/compress/compress.go 81.90% <0.00%> (-1.91%) ⬇️
pkg/app/server/hertz.go 82.69% <0.00%> (+7.69%) ⬆️

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.

resp, err := http.Get("http://127.0.0.1:6669/test")
assert.NotNil(t, err)
assert.Nil(t, resp)
assert.DeepEqual(t, uint32(0), atomic.LoadUint32(&testint))
Copy link
Member

@Duslia Duslia Nov 24, 2022

Choose a reason for hiding this comment

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

Should we test panic on the basis of server.New? Because it only has one more middleware than server.new

Copy link
Member

Choose a reason for hiding this comment

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

PATL @mamil

@mamil mamil closed this Dec 30, 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.

4 participants