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

Support sending test report to a gRPC server #92

Closed
LinuxSuRen opened this issue Jun 15, 2023 · 8 comments · Fixed by #431
Closed

Support sending test report to a gRPC server #92

LinuxSuRen opened this issue Jun 15, 2023 · 8 comments · Fixed by #431
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@LinuxSuRen
Copy link
Owner

LinuxSuRen commented Jun 15, 2023

Sometimes, we might want to send the test report to a gRPC server.

How to

It's easy to do this. Please implement the following interface first:

type TestReporter interface {

then, add the corresponding CLI flag.

flags.StringVarP(&opt.pattern, "pattern", "p", "test-suite-*.yaml",

Similar issues

How to test

We could try to send the test report to etcd.

@LinuxSuRen LinuxSuRen added enhancement New feature or request good first issue Good for newcomers labels Jun 15, 2023
@lizzy-0323
Copy link
Contributor

Hello, I would like to have a try🙋🏻‍♀️ on this issue!

@LinuxSuRen
Copy link
Owner Author

I'm looking forward it.

@lizzy-0323
Copy link
Contributor

我的思路:
定义一个grpcResultWriter去实现接口,结构体需要有grpc server的url以及protobuf文件存放的文件地址,
根据proto文件存放的地址来建立对应的grpc客户端,在此过程中,无需关注[]ReportResult的具体内容。
测试思路:
运行单机etcd服务,调用etcd客户端api上传报告(不过目前不太了解etcd,后续还得再看看)
请问我的思路正确吗?

@LinuxSuRen
Copy link
Owner Author

您好,思路是没问题的。测试的时候,不一定要找 etcd,这个可能会稍微复杂点。理论上,随便实现一个(或找个现成的)gRPC 服务就可以完成测试。

@lizzy-0323
Copy link
Contributor

lizzy-0323 commented May 12, 2024

您好,请问编写的protobuf文件和生成的代码部分应该存放在哪个文件夹下呢?
另外,应该可以直接采用grpc.go文件中的invokeRequest函数来发起请求?

@LinuxSuRen
Copy link
Owner Author

我的理解是 protobuf 是来自第三方系统(例如:etcd),可以调用 invokeRequest(或者需要重构)来实现调用,而不需要生成代码,反射的方式会比较好一些。因为,我们无法预知会调用哪些 gRPC 服务,可能会有各种不同的,无法把哪些 proto 以及代码都保存下来。

@lizzy-0323
Copy link
Contributor

好的,我大概了解了,这样的话核心任务应该是根据grpc.go中的一些方法进行重构,完成grpc通信里建立连接,获取文件描述符以及protobuf和json转换相关的操作。

@LinuxSuRen
Copy link
Owner Author

嗯嗯,其实就是一个通用型的 gRPC 请求调用,把我们相对固定的数据发送过去。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants