kubernetes-testing-framework icon indicating copy to clipboard operation
kubernetes-testing-framework copied to clipboard

Object Lifecycle Sequence Testing Utilities

Open shaneutt opened this issue 3 years ago • 2 comments

Problem Statement

Most of the time when testing the state of an API object the lineage of changes to it's observed (and sometimes declared) state are predictable and reproducible in a testing environment.

The purpose of this task is to add high level functionality that allows the caller to write very simple and generic tests which verify the sequence of lifecycle events for an object.

Acceptance Criteria

  • [ ] when writing tests for controllers I can describe the entire series of lifecycle events that are expected to occur for a resource as it's being processed by its controller(s) as a high level data structure
  • [ ] it's possible with the testing structure to optionally enable non-strict sequence wherein the events that occur simply need to be in the right order, but other undefined events are permitted between the defined ones
  • [ ] this testing functionality integrates well with github.com/stretchr/testify testing functions

shaneutt avatar Jul 08 '22 03:07 shaneutt

Can we ensure we don't miss any state change in an object if it switches states too fast?

jrsmroz avatar Jul 08 '22 08:07 jrsmroz

Can we ensure we don't miss any state change in an object if it switches states too fast?

Yes it should be feasible to capture all state changes along the resource version lineage.

shaneutt avatar Jul 08 '22 14:07 shaneutt