From cb2d8b3aef0920cbb5521f948e262598efc3fc1c Mon Sep 17 00:00:00 2001 From: Sabyrzhan Tasbolatov Date: Wed, 4 Sep 2024 21:33:28 +0500 Subject: pkg/rpcserver: add unit tests, Manager mocks Added more test coverage of the package and created an interface of rpcserver to use it as the dependency (for syz-manager). Also tried to cover with tests a private method handleConn(), though it calls handleRunnerConn which has a separate logic in Handshake(), which within handleConn() unit test we should've mocked. This will require a refactoring of `runners map[int]*Runner` and runner.go in general with a separate interface which we can mock as well. General idea is to have interfaces of Server (rpc), Runner etc. and mock a compound logic like Handshake during a separate public (or private if it has callable, if-else logic) method unit-testing. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b8502f2da..f4c94c45e 100644 --- a/Makefile +++ b/Makefile @@ -232,7 +232,7 @@ generate: $(MAKE) format generate_go: format_cpp - $(GO) generate ./executor ./pkg/ifuzz ./pkg/build + $(GO) generate ./executor ./pkg/ifuzz ./pkg/build ./pkg/rpcserver $(GO) generate ./vm/proxyapp generate_rpc: -- cgit mrf-deployment