megaease / easemesh

A service mesh implementation for connecting, control, and observe services in spring-cloud.
https://megaease.com/easemesh
Apache License 2.0
508 stars 61 forks source link

Promoting test coverage of codes #85

Closed zhao-kun closed 3 years ago

zhao-kun commented 3 years ago

A dedicated PR to promoting test coverage of emctl

codecov-commenter commented 3 years ago

Codecov Report

Merging #85 (ce6409d) into main (b25e60b) will decrease coverage by 43.88%. The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##             main      #85       +/-   ##
===========================================
- Coverage   65.91%   22.03%   -43.89%     
===========================================
  Files           2       20       +18     
  Lines         267     1970     +1703     
===========================================
+ Hits          176      434      +258     
- Misses         73     1456     +1383     
- Partials       18       80       +62     
Impacted Files Coverage Δ
...mctl/cmd/client/command/meshinstall/base/config.go 100.00% <ø> (ø)
...tl/cmd/client/command/meshinstall/base/k8sutils.go 0.00% <0.00%> (ø)
.../cmd/client/command/meshinstall/operator/deploy.go 0.00% <0.00%> (ø)
emctl/cmd/client/util/builder.go 32.94% <0.00%> (ø)
...d/client/command/meshinstall/operator/rbac_spec.go 0.00% <0.00%> (ø)
emctl/cmd/client/util/visitor.go 30.41% <0.00%> (ø)
...mmand/meshinstall/operator/mutatingwebhook_spec.go 0.00% <0.00%> (ø)
...ctl/cmd/client/command/meshinstall/operator/csr.go 0.00% <0.00%> (ø)
...nt/command/meshinstall/operator/deployment_spec.go 0.00% <0.00%> (ø)
... and 11 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 b25e60b...ce6409d. Read the comment docs.

zhao-kun commented 3 years ago

In order to promote test coverage, I changed some function signatures, prefer to using kubernetes.Interface instead of concrete kubernetes.Clientset for mocking K8s behavior.

I think we could review & merge it to the main branch for avoiding conflict due to changes.