Documentation ¶
Index ¶
- Constants
- func Compare(content, golden []byte) error
- func CompareBytes(content []byte, golden []byte, name string, t *testing.T)
- func CompareContent(content []byte, goldenFile string, t *testing.T)
- func CompareYAML(filename string, t *testing.T)
- func CopyPodFiles(container, pod, ns, source, dest string)
- func CreateNamespace(cl kubernetes.Interface) (string, error)
- func CreateNamespaceWithPrefix(cl kubernetes.Interface, prefix string, inject bool) (string, error)
- func DeleteNamespace(cl kubernetes.Interface, ns string)
- func FetchLogs(cl kubernetes.Interface, name, namespace string, container string) string
- func GetAppPods(cl kubernetes.Interface, kubeconfig string, nslist []string) (map[string][]string, error)
- func GetPods(cl kubernetes.Interface, ns string) []string
- func ReadFile(file string, t *testing.T) []byte
- func ReadGoldenFile(content []byte, goldenFile string, t *testing.T) []byte
- func Refresh() bool
- func Run(command string) error
- func RunInput(command, input string) error
- func Shell(command string) (string, error)
Constants ¶
const (
// PodCheckBudget is the maximum number of retries with 1s delays
PodCheckBudget = 200
)
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
Compare compares two byte slices. It returns an error with a contextual diff if they are not equal.
func CompareBytes ¶
CompareBytes compares the content value against the golden bytes and fails the test if they differ
func CompareContent ¶
CompareContent compares the content value against the golden file and fails the test if they differ
func CompareYAML ¶
CompareYAML compares a file "x" against a golden file "x.golden"
func CopyPodFiles ¶
func CopyPodFiles(container, pod, ns, source, dest string)
CopyPodFiles copies files from a pod to the machine
func CreateNamespace ¶
func CreateNamespace(cl kubernetes.Interface) (string, error)
CreateNamespace creates a fresh namespace
func CreateNamespaceWithPrefix ¶
CreateNamespaceWithPrefix creates a fresh namespace with the given prefix
func DeleteNamespace ¶
func DeleteNamespace(cl kubernetes.Interface, ns string)
DeleteNamespace removes a namespace
func FetchLogs ¶
func FetchLogs(cl kubernetes.Interface, name, namespace string, container string) string
FetchLogs for a container in a a pod
func GetAppPods ¶
func GetAppPods(cl kubernetes.Interface, kubeconfig string, nslist []string) (map[string][]string, error)
GetAppPods awaits till all pods are running in a namespace, and returns a map from "app" label value to the pod names.
func GetPods ¶
func GetPods(cl kubernetes.Interface, ns string) []string
GetPods gets pod names in a namespace
func ReadFile ¶
ReadFile reads the content of the given file or fails the test if an error is encountered.
func ReadGoldenFile ¶
ReadGoldenFile reads the content of the golden file and fails the test if an error is encountered
func Refresh ¶
func Refresh() bool
Refresh controls whether to update the golden artifacts instead. It is set using the environment variable REFRESH_GOLDEN.
Types ¶
This section is empty.