Skip to content

Missing unit tests for RuntimeReconciler lifecycle logic #5657

@mrhapile

Description

@mrhapile

The core runtime reconciliation logic currently lacks unit test coverage, which makes future changes to runtime lifecycle handling risky and harder to validate.

RuntimeReconciler is responsible for managing the full lifecycle of a runtime (Setup, Sync, Delete), including critical behaviors such as owner references, finalizers, requeue logic, and cleanup during deletion. At the moment, these behaviors are not protected by unit tests.

Why this matters

  • Runtime reconciliation is core control-plane logic
  • Changes to this code can silently introduce regressions
  • Lack of unit tests makes refactoring and maintenance harder
  • Controller-level tests improve long-term stability and contributor confidence

Evidence

  • pkg/controllers/runtime_controller.go contains the main reconciliation logic
  • No corresponding runtime_controller_test.go existed prior to this fix
  • Other controller files in the same directory show similar testing gaps

Proposed Solution

  • Add controller-level unit tests using controller-runtime’s fake client to validate:
  • OwnerReference creation linking Runtime → Dataset
  • Finalizer addition during normal reconciliation
  • Finalizer removal and cleanup during deletion
  • Happy-path reconciliation (Setup / Sync)

Error propagation when runtime engine creation fails

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions