...

Source file src/edge-infra.dev/test/f2/x/ktest/kpoll/doc.go

Documentation: edge-infra.dev/test/f2/x/ktest/kpoll

     1  // Package kpoll provides a wrapper around [gotest.tools/v3/poll] to facilitate
     2  // continually evaluating checks on K8s objects against a live cluster.
     3  //
     4  // It is intended to be used for integration/end-to-end testing (e.g., envtest).
     5  //
     6  // kpoll composes with [edge-infra.dev/pkg/k8s/testing/kmp] to allow sharing
     7  // Object comparison logic across unit tests and tests against live clusters.
     8  //
     9  // The main way to interact with kpoll is to create an instance of [KPoll] for
    10  // each test you want to make assertions against clusters in:
    11  //
    12  //	func TestReconciler(t *testing.T) {
    13  //		kp := kpoll.New(context.Background(), kubeClient, defaultTimeout, defaultTick)
    14  //		kp.WaitOn(t, kp.ObjExists(obj))
    15  //		// Use a kmp.Komparison
    16  //		kp.WaitOn(t, kp.Check(obj, kmp.IsReady()))
    17  //	}
    18  package kpoll
    19  

View as plain text