Standardized test checklist for reconciler and core engine components. These tests validate the central orchestration logic that ties providers and sources together.
Philosophy: The reconciler is the brain of dnsweaver. It must handle every combination of provider state, source output, and failure mode gracefully.
packagereconciler_testimport("context""testing""gitlab.bluewillows.net/root/dnsweaver/internal/reconciler""gitlab.bluewillows.net/root/dnsweaver/internal/testutil")funcTestReconcile_BasicCreateFlow(t*testing.T){prov:=testutil.NewMockProvider("test","example.com.")src:=testutil.NewMockSource()src.SetWorkloads(testutil.SimpleWorkload("web","web.example.com","192.0.2.1"),)r:=newTestReconciler(t,prov,src)result,err:=r.Reconcile(context.Background())testutil.RequireNoError(t,err)// Verify A record createdtestutil.AssertRecordExists(t,prov.Created(),"web.example.com","A")}
The Result struct provides detailed inspection of what happened:
result,err:=r.Reconcile(ctx)// Check outcomesresult.HasErrors()// Any errors occurredresult.Actions()// All actions takenresult.Created()// Records createdresult.Deleted()// Records deletedresult.Updated()// Records updatedresult.Skipped()// Records skipped (no change needed)result.Failed()// Actions that failed