Skip to content

Commit 27b307f

Browse files
committed
Add documentation to force build
1 parent b66c4b2 commit 27b307f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

pkg/testutil/doc.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Package testutil provides test utility for Kubernetes operators. The amin
2+
// support is around envtest and resource watching logic, where you can use
3+
// the following code to wait for the matching resource to appear.
4+
//
5+
// Example:
6+
//
7+
// watcher.SetCmpOpts(testutil.CompareSpecOnly()...)
8+
// expectedSts := &appsv1.StatefulSet{
9+
// Spec: appsv1.StatefulSetSpec{Replicas: ptr.To(int32(3))},
10+
// }
11+
// expectedSvc := &corev1.Service{...}
12+
//
13+
// err := watcher.WaitForMatch(expectedSts, expectedSvc)
14+
// if err != nil {
15+
// t.Errorf("Resources never reached expected state: %v", err)
16+
// }
17+
//
18+
// This utility allows resource matching logic to be fully declarative, and
19+
// while integration tests are more expensive to run in terms of time spent,
20+
// this makes sure that there is no unnecessary sleep logic, and all the tests
21+
// can be run in an event driven fashion.
22+
package testutil

0 commit comments

Comments
 (0)