neondatabase / autoscaling

Postgres vertical autoscaling in k8s
Apache License 2.0
150 stars 20 forks source link

Basic unit testing coverage for neonvm-controller #763

Open sharnoff opened 7 months ago

sharnoff commented 7 months ago

Optional for neondatabase/company_projects#187.

Problem description / Motivation

The neonvm-controller's reconcile functions are huge and complex, with the majority of testing coming from system-wide end-to-end tests.

This leaves us over-exposed to uncommon scenarios or edge cases, along with little testing against degradations.

Feature idea(s) / DoD

More testing for the reconcile functions, mostly just to get it started. This is a continuing process

Implementation ideas

We may want to do something like what pkg/agent/core/state.go does, where the core of the logic is pure, and just returns the desired action to take.

While that would be a lot of work, maybe it's worth it to "force" all of the state to exist outside the control flow.

Also to look at how other k8s controllers are tested.

Related issues

sharnoff commented 2 months ago

Status: