testcontext

package
v0.0.0-...-d0b8644 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnyToken                  = "any"
	AuthorizationHeaderName   = "Authorization"
	AuthorizationHeaderPrefix = "Bearer"
	OpaqueHeaderName          = "opaque-token"
)

Variables

This section is empty.

Functions

func AddApiGatewayCRIntoContext

func AddApiGatewayCRIntoContext(ctx context.Context, apiGateway *v1alpha1.APIGateway) context.Context

func AddCreatedTestObjectInContext

func AddCreatedTestObjectInContext(ctx context.Context, object client.Object) context.Context

func GetApiGatewayCRsFromContext

func GetApiGatewayCRsFromContext(ctx context.Context) ([]*v1alpha1.APIGateway, bool)

func GetCreatedTestObjectsFromContext

func GetCreatedTestObjectsFromContext(ctx context.Context) ([]client.Object, bool)

func GetK8sClientFromContext

func GetK8sClientFromContext(ctx context.Context) (client.Client, error)

func GetRetryOpts

func GetRetryOpts() []retry.Option

func GetTestingFromContext

func GetTestingFromContext(ctx context.Context) (*testing.T, error)

func SetK8sClientInContext

func SetK8sClientInContext(ctx context.Context, k8sClient client.Client) context.Context

func SetTestingInContext

func SetTestingInContext(ctx context.Context, testing *testing.T) context.Context

Types

type Config

type Config struct {
	CustomDomain     string `envconfig:"TEST_CUSTOM_DOMAIN,default=test.domain.kyma"`
	OIDCConfigUrl    string `envconfig:"TEST_OIDC_CONFIG_URL,default=empty"`
	IssuerUrl        string `envconfig:"-"`
	ClientID         string `envconfig:"TEST_CLIENT_ID,default=empty"`
	ClientSecret     string `envconfig:"TEST_CLIENT_SECRET,default=empty"`
	ReqTimeout       uint   `envconfig:"TEST_REQUEST_TIMEOUT,default=240"`
	ReqDelay         uint   `envconfig:"TEST_REQUEST_DELAY,default=5"`
	Domain           string `envconfig:"TEST_DOMAIN,default=local.kyma.dev"`
	GatewayName      string `envconfig:"TEST_GATEWAY_NAME,default=kyma-gateway"`
	GatewayNamespace string `envconfig:"TEST_GATEWAY_NAMESPACE,default=kyma-system"`
	TestConcurrency  int    `envconfig:"TEST_CONCURRENCY,default=4"`
	IstioNamespace   string `envconfig:"TEST_ISTIO_NAMESPACE,default=istio-system"`
	IsGardener       bool   `envconfig:"IS_GARDENER,default=false"`
}

func GetConfig

func GetConfig() Config

type Testsuite

type Testsuite interface {
	Name() string
	FeaturePath() []string
	InitScenarios(ctx *godog.ScenarioContext)
	Setup() error
	TearDown()
	ResourceManager() *resource.Manager
	K8sClient() dynamic.Interface
	BeforeSuiteHooks() []func() error
	AfterSuiteHooks() []func() error
}

func New

func New(config Config, factory TestsuiteFactory) (Testsuite, error)

type TestsuiteFactory

type TestsuiteFactory func(httpClient *helpers.RetryableHttpClient, k8sClient dynamic.Interface, rm *resource.Manager, config Config) Testsuite

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL