-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdoc.go
More file actions
26 lines (26 loc) · 768 Bytes
/
doc.go
File metadata and controls
26 lines (26 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Package framework provides a deckhouse-style testing framework for module-sdk hooks.
//
// It is inspired by deckhouse/testing/hooks but does not depend on
// addon-operator or shell-operator. Internally it uses a fake Kubernetes
// client (k8s.io/client-go/dynamic/fake) to simulate cluster state.
//
// Typical usage:
//
// func TestMyHook(t *testing.T) {
// f := framework.HookExecutionConfigInit(t, hookConfig, MyHookHandler, `{}`, `{}`)
//
// f.KubeStateSet(`
// ---
// apiVersion: v1
// kind: Node
// metadata:
// name: kube-worker-1
// `)
//
// f.RunHook()
//
// require.NoError(t, f.HookError())
// require.Len(t, f.Snapshots().Get("nodes"), 1)
// require.Equal(t, "value", f.ValuesGet("my.field").String())
// }
package framework