Skip to content

test: implement reconciler unit tests #23

@dennisonbertram

Description

@dennisonbertram

Skeleton tests exist in internal/reconciler/reconciler_test.go — all currently t.Skip. Implement using testutil.NewStateDB and testutil.MockDockerClient.

Tests to implement:

  • TestReconciler_CircuitBreaker — simulate 5 crashes in 600s window, verify circuit_open=1 and circuit_retry_at is set
  • TestReconciler_AutoRecovery — set circuit_retry_at to past, run tick, verify circuit reset and status=stopped
  • TestReconciler_UnhealthyRestart — mock InspectContainer returning HealthStatus="unhealthy", verify StopContainer called
  • TestReconciler_StaleDeployment — service with status=deploying and updated_at >10min, verify marked failed

Depends on: #test-wire-migrations (testutil must use real migration runner)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions