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 unit test case for func in cli/inspect package #2599

Merged
merged 1 commit into from
Jan 15, 2019

Conversation

jahentao
Copy link
Contributor

Signed-off-by: jahentao jahentao@qq.com

Ⅰ. Describe what this PR did

test: add unit test case for func in cli/inspect package, such as TestNewTemplateInspector, TestNewTemplateInspectorFromString, TestInspect, TestTemplateInspector_Inspect, TestTemplateInspector_Flush, TestNewIndentedInspector, TestIndentedInspector_Inspect, TestIndentedInspector_Flush

Ⅱ. Does this pull request fix one issue?

NONE

Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)

added

Ⅳ. Describe how to verify it

# go test -timeout 30s github.com/alibaba/pouch/cli/inspect 
ok  	github.com/alibaba/pouch/cli/inspect	0.003s

# go test -timeout 30s github.com/alibaba/pouch/cli/inspect -cover
ok  	github.com/alibaba/pouch/cli/inspect	0.003s	coverage: 90.9% of statements

Ⅴ. Special notes for reviews

for some reason, I add a repository github.com/google/go-cmp/cmp for comparing of two Template, because the reflect.DeepEqual method not works.

@codecov
Copy link

codecov bot commented Dec 21, 2018

Codecov Report

Merging #2599 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2599      +/-   ##
==========================================
- Coverage   69.57%   69.56%   -0.02%     
==========================================
  Files         280      280              
  Lines       18844    18844              
==========================================
- Hits        13111    13108       -3     
+ Misses       4268     4265       -3     
- Partials     1465     1471       +6
Flag Coverage Δ
#criv1alpha1test 31.23% <ø> (-0.18%) ⬇️
#criv1alpha2test 35.62% <ø> (-0.09%) ⬇️
#integrationtest 41.7% <ø> (+0.02%) ⬆️
#nodee2etest 32.79% <ø> (+0.05%) ⬆️
#unittest 26.91% <ø> (ø) ⬆️
Impacted Files Coverage Δ
ctrd/watch.go 81.69% <0%> (-2.82%) ⬇️
daemon/logger/jsonfile/utils.go 71.54% <0%> (-1.63%) ⬇️
cri/v1alpha2/cri_wrapper.go 65.59% <0%> (-1.21%) ⬇️
cri/v1alpha1/cri.go 59.43% <0%> (-0.67%) ⬇️
cri/v1alpha2/cri.go 67.57% <0%> (-0.5%) ⬇️
daemon/mgr/container.go 58.79% <0%> (-0.22%) ⬇️
ctrd/container.go 58.89% <0%> (+0.79%) ⬆️
daemon/mgr/spec_linux.go 77.74% <0%> (+0.99%) ⬆️
ctrd/image.go 78.18% <0%> (+2.27%) ⬆️
apis/server/utils.go 75% <0%> (+3.84%) ⬆️

@Ace-Tang
Copy link
Contributor

I am not find change in vendor.json, don't you use govendor to add vendor packages ?

@jahentao
Copy link
Contributor Author

vendor.json

emm, I add it in under the vendor directory. Sorry, i'm a green hand. o(╥﹏╥)o

@Ace-Tang
Copy link
Contributor

Check this, https://github.com/kardianos/govendor
you can use govendor add $package to add or govendor add +external.

@jahentao
Copy link
Contributor Author

Check this, https://github.com/kardianos/govendor
you can use govendor add $package to add or govendor add +external.

@Ace-Tang Thank you very much, I have added it. I'm happy to learn a new skill. (^▽^)

@jahentao
Copy link
Contributor Author

@chuanchang Thank you for your reviewing, feedback and for giving me the opportunity to improve my work. I am looking forward to hearing from you soon.

@chuanchang
Copy link
Contributor

LGTM, @Ace-Tang @allencloud please give a double check, thanks.

Signed-off-by: jahentao <jahentao@qq.com>
@jahentao
Copy link
Contributor Author

Happy New Year! Even though it has little technical content, It's a meaningful PR of my PaaS homework in the past year. It is an important milestone for me to entry opensource and join a helpful community.

@allencloud
Copy link
Collaborator

So good to have you. @jahentao Please feel free to contact with us on GitHub or dingtalk group if you have any question. Thanks.

@jahentao
Copy link
Contributor Author

jahentao commented Jan 8, 2019

Emm, Can this PR be merged? Or, what's wrong with it? o(╥﹏╥)o

@allencloud allencloud merged commit 60b8ce5 into AliyunContainerService:master Jan 15, 2019
@allencloud
Copy link
Collaborator

Thanks for your work. Really appreciate it. @jahentao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants