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

Add unit test for newClientCfg #13830

Merged
merged 1 commit into from
Mar 23, 2022
Merged

Conversation

ahrtr
Copy link
Member

@ahrtr ahrtr commented Mar 21, 2022

Added a unit test for the original newClientCfg.

cc @serathius @spzala

@codecov-commenter
Copy link

codecov-commenter commented Mar 21, 2022

Codecov Report

Merging #13830 (7d2ca9b) into main (6d39359) will decrease coverage by 0.10%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main   #13830      +/-   ##
==========================================
- Coverage   72.57%   72.47%   -0.11%     
==========================================
  Files         467      467              
  Lines       38280    38282       +2     
==========================================
- Hits        27781    27743      -38     
- Misses       8722     8749      +27     
- Partials     1777     1790      +13     
Flag Coverage Δ
all 72.47% <100.00%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
etcdctl/ctlv3/command/global.go 59.03% <100.00%> (+0.36%) ⬆️
client/v3/namespace/watch.go 87.87% <0.00%> (-6.07%) ⬇️
raft/rafttest/node.go 95.00% <0.00%> (-5.00%) ⬇️
client/v3/concurrency/session.go 88.63% <0.00%> (-4.55%) ⬇️
client/pkg/v3/testutil/leak.go 62.83% <0.00%> (-4.43%) ⬇️
server/storage/mvcc/watchable_store.go 85.50% <0.00%> (-3.63%) ⬇️
server/etcdserver/util.go 85.71% <0.00%> (-3.18%) ⬇️
pkg/traceutil/trace.go 96.15% <0.00%> (-1.93%) ⬇️
pkg/schedule/schedule.go 81.69% <0.00%> (-1.41%) ⬇️
pkg/adt/interval_tree.go 85.96% <0.00%> (-1.26%) ⬇️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6d39359...7d2ca9b. Read the comment docs.

@ahrtr ahrtr force-pushed the add_ut_newClientCfg branch 2 times, most recently from 43f4ae0 to 7d2ca9b Compare March 21, 2022 23:23
@ahrtr ahrtr force-pushed the add_ut_newClientCfg branch from 7d2ca9b to 3780435 Compare March 22, 2022 11:08
@ahrtr
Copy link
Member Author

ahrtr commented Mar 22, 2022

Resolved all comments.

}
}

func TestNewClientConfigWithSecureCfg(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

What is the reason this can be added as test case to above test?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because github.com/stretchr/testify/assert doesn't support comparing function, and tls.Config contains fields of function type if we provide Cert/Key/Cacert.

@serathius serathius merged commit 4504daa into etcd-io:main Mar 23, 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.

3 participants