dubbo-kubernetes icon indicating copy to clipboard operation
dubbo-kubernetes copied to clipboard

#84 feat: add test in console

Open dawnzzz opened this issue 1 year ago • 9 comments

add test in console using rpc reflection

dawnzzz avatar Jan 21 '24 08:01 dawnzzz

If you have any question about the initialization process or cases writing. Please let me know.

DMwangnima avatar Jan 22 '24 02:01 DMwangnima

基于gRPC reflection进行服务测试,基本流程如下:

  1. 通过reflection获取信息,包括但不限于:
    • service name list
    • method name list
    • describe string(proto定义)
    • template string(输入/输出 json 模版)
  2. 基于接口信息 invoke,支持unary,client stream,server stream,bi-stream模式,input format is json

应用侧需要:

  • 对于gRPC应用,需要开启grpc reflection
  • 对于dubbo应用,triple协议目前已经默认开启了reflection,并且与grpc reflection兼容,故可以通过grpc reflection获取接口信息(对于 dubbo go应用,测试于 d2ed4f534bdfb14f59f795297c896cf18bb72cd4,更早的版本可能会不支持 reflection/不兼容grpc reflection)

dawnzzz avatar Jan 24 '24 08:01 dawnzzz

Codecov Report

Attention: Patch coverage is 37.18593% with 125 lines in your changes are missing coverage. Please review.

Project coverage is 45.19%. Comparing base (4f53bb5) to head (a8bc95d). Report is 75 commits behind head on master.

:exclamation: Current head a8bc95d differs from pull request most recent head 417a801. Consider uploading reports for the commit 417a801 to get more accurate results

Files Patch % Lines
pkg/admin/util/reflection/reflection.go 50.68% 51 Missing and 21 partials :warning:
pkg/admin/services/service_testing_impl.go 0.00% 51 Missing :warning:
app/dubboctl/internal/kube/component.go 0.00% 1 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #159      +/-   ##
==========================================
+ Coverage   44.91%   45.19%   +0.27%     
==========================================
  Files         280      281       +1     
  Lines       17302    17357      +55     
  Branches       41       41              
==========================================
+ Hits         7772     7845      +73     
+ Misses       8705     8665      -40     
- Partials      825      847      +22     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jan 26 '24 05:01 codecov-commenter

LGTM. BTW, pls fix the lint problem.

I dont find lint problem, and I exec command 'make lint' in local which result is sussessful.

I'm confused. I don't know what the problem is. 🤔️

dawnzzz avatar Feb 11 '24 13:02 dawnzzz

LGTM. BTW, pls fix the lint problem.

I dont find lint problem, and I exec command 'make lint' in local which result is sussessful.

I'm confused. I don't know what the problem is. 🤔️

cc @chickenlj .

DMwangnima avatar Feb 11 '24 13:02 DMwangnima

IMO, you can running the command /home/runner/golangci-lint-1.56.1-linux-amd64/golangci-lint run --out-format=github-actions --timeout=30m -v --disable-all --enable=gofumpt --enable=govet --enable=staticcheck --enable=ineffassign --enable=misspell in local machine, maybe find some questions. @dawnzzz 🤔️

yuluo-yx avatar Feb 15 '24 11:02 yuluo-yx

IMO, you can running the command /home/runner/golangci-lint-1.56.1-linux-amd64/golangci-lint run --out-format=github-actions --timeout=30m -v --disable-all --enable=gofumpt --enable=govet --enable=staticcheck --enable=ineffassign --enable=misspell in local machine, maybe find some questions. @dawnzzz 🤔️

Thank you for your help, but running the command locally without errors...

dawnzzz avatar Feb 16 '24 09:02 dawnzzz

image

chickenlj avatar Feb 28 '24 01:02 chickenlj

@dawnzzz Above is where the lint error is reported.

chickenlj avatar Feb 28 '24 02:02 chickenlj