autoscaling icon indicating copy to clipboard operation
autoscaling copied to clipboard

Basic unit testing coverage for neonvm-controller

Open sharnoff opened this issue 6 months ago • 1 comments

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

  • #716
  • #733
### Tasks
- [ ] https://github.com/neondatabase/autoscaling/pull/935
- [ ] https://github.com/neondatabase/autoscaling/pull/943
- [ ] Another PR with more thorough coverage and refactoring
- [ ] Show coverage in CI

sharnoff avatar Jan 25 '24 18:01 sharnoff