Documentation ¶
Overview ¶
Package testutil provides common helper for tests.
Index ¶
Constants ¶
View Source
const (
// KubeconfigEnv is a environment variable name which points to kubeconfig file which will be used for testing.
KubeconfigEnv = "KUBECONFIG"
)
Variables ¶
This section is empty.
Functions ¶
func CheckStatusCodeOK ¶
func CheckStatusCodeOK(ctx context.Context, t *testing.T, httpClient *http.Client, url string) []byte
CheckStatusCodeOK sends GET request to given URL until it returns code 200, then it returns received body.
If 401 or 403 return code is received, function will retry.
If other return code is received, function will fail given test.
Types ¶
type TestEnv ¶
type TestEnv struct { PersonalAPIKey string AccountID string Region string Config string ConfigPath string ServingCertPath string ServingKeyPath string KubeconfigPath string Port string Host string BaseURL string Flags []string ContextTimeout time.Duration StartKubernetes bool Context context.Context RestConfig *rest.Config HTTPClient *http.Client }
TestEnv is a helper struct for accessing data required for integration and e2e tests like API key and to perform common test tasks, like generating clients, parameters for adapter etc.
Click to show internal directories.
Click to hide internal directories.