Hi maintainers,
I've been getting set up to contribute and while going through chaoscenter/graphql/server I noticed two related gaps. Wanted to open this as a discussion before writing any code, per the CONTRIBUTING guide.
A few core packages have no test files at all
While checking coverage, these have zero _test.go files:
pkg/projects (project_handler.go) — handles project creation/init, no tests
pkg/probe (handler/handler.go) — has a ready-made mock in pkg/probe/model/mocks/service.go that nothing currently uses
pkg/image_registry, pkg/gitops, pkg/grpc , same situation
pkg/projects and pkg/probe seemed like the most self-contained ones to start with since they already depend on the mongodb.MongoOperator interface, which is mockable, and pkg/probe already has the mock scaffolding sitting there unused.
Proposed scope
If this sounds reasonable, I'd like to take on:
Adding a complexity limit to the gqlgen handler in server.go (open to whatever threshold makes sense, can also look at depth limiting if preferred)
Writing unit tests for pkg/projects/project_handler.go and pkg/probe/handler/handler.go using the existing mocks
Hi maintainers,
I've been getting set up to contribute and while going through
chaoscenter/graphql/serverI noticed two related gaps. Wanted to open this as a discussion before writing any code, per the CONTRIBUTING guide.A few core packages have no test files at all
While checking coverage, these have zero
_test.gofiles:pkg/projects(project_handler.go)— handles project creation/init, no testspkg/probe(handler/handler.go)— has a ready-made mock inpkg/probe/model/mocks/service.gothat nothing currently usespkg/image_registry,pkg/gitops,pkg/grpc, same situationpkg/projectsandpkg/probeseemed like the most self-contained ones to start with since they already depend on themongodb.MongoOperatorinterface, which is mockable, andpkg/probealready has the mock scaffolding sitting there unused.Proposed scope
If this sounds reasonable, I'd like to take on:
Adding a complexity limit to the gqlgen handler in
server.go(open to whatever threshold makes sense, can also look at depth limiting if preferred)Writing unit tests for
pkg/projects/project_handler.goandpkg/probe/handler/handler.gousing the existing mocks