Documentation ¶
Index ¶
- func ExecuteTestruns(log logr.Logger, config *Config, runs RunList, testrunNamePrefix string, ...) error
- func GetArgoHost(ctx context.Context, tmClient client.Client) (string, error)
- func GetArgoURL(ctx context.Context, k8sClient client.Client, tr *tmv1beta1.Testrun) (string, error)
- func GetArgoURLFromHost(host string, tr *tmv1beta1.Testrun) string
- func GetGrafanaHost(ctx context.Context, tmClient client.Client) (string, error)
- func GetGrafanaURLFromHostForPod(host string, podname string) string
- func GetGrafanaURLFromHostForStep(host string, workflowName, testdefName string) string
- func GetGrafanaURLFromHostForWorkflow(host string, workflowName string) string
- func GetHostURLFromIngress(ctx context.Context, tmClient client.Client, obj types.NamespacedName) (string, error)
- func GetHostURLFromIngressObject(ingress *netv1.Ingress) (string, error)
- func GetTMDashboardHost(tmClient client.Client) (string, error)
- func GetTmDashboardURLForTestrun(tmClient client.Client, tr *tmv1beta1.Testrun) (string, error)
- func GetTmDashboardURLFromHostForExecutionGroup(host, executiongroupID string) string
- func GetTmDashboardURLFromHostForTestrun(host string, tr *tmv1beta1.Testrun) string
- type Config
- type Executor
- type ExecutorConfig
- type Rerenderer
- type Run
- type RunEventFunc
- type RunList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteTestruns ¶
func ExecuteTestruns(log logr.Logger, config *Config, runs RunList, testrunNamePrefix string, notify ...chan *Run) error
ExecuteTestruns deploys it to a testmachinery cluster and waits for the testruns results
func GetArgoHost ¶
GetArgoHost returns the host of the argo ui
func GetArgoURL ¶
func GetArgoURLFromHost ¶
GetArgoURLFromHost returns the url for a specific workflow with a given base path
func GetGrafanaHost ¶
GetGrafanaHost returns the host of the grafana instance in the monitoring namespace
func GetGrafanaURLFromHostForPod ¶
GetGrafanaURLFromHostForPod returns the path to the logs in grafana for a specific pod
func GetGrafanaURLFromHostForStep ¶
GetGrafanaURLFromHostForStep returns the path to the logs in grafana for a specific step
func GetGrafanaURLFromHostForWorkflow ¶
GetGrafanaURLFromHostForWorkflow returns the path to the logs in grafana for a whole workflow
func GetHostURLFromIngress ¶
func GetHostURLFromIngress(ctx context.Context, tmClient client.Client, obj types.NamespacedName) (string, error)
GetClusterDomainURL tries to derive the cluster domain url from an grafana ingress if possible. Returns an error if the ingress cannot be found or is in unexpected form.
func GetHostURLFromIngressObject ¶
GetHostURLFromIngressObject tries to derive the cluster domain url from an ingeress object. Returns an error if the ingress is in unexpected form.
func GetTMDashboardHost ¶
GetTMDashboardHost returns the host of the TestMachinery Dashboard
func GetTmDashboardURLForTestrun ¶
GetTmDashboardURLForTestrun returns the dashboard URL to a testrun
func GetTmDashboardURLFromHostForExecutionGroup ¶
GetTmDashboardURLFromHostForExecutionGroup returns the dashboard URL to a execution group with a given dashboard host
Types ¶
type Config ¶
type Config struct { // Testrun watch controller Watch watch.Watch // Namespace where the testrun is deployed. Namespace string // Max wait time for a testrun to finish. Timeout time.Duration // Number of testrun retries after a failed run FlakeAttempts int // NoExecutionGroup configures if a execution group id should be injected into every testrun. NoExecutionGroup bool ExecutorConfig }
Config are configuration of the environment like the testmachinery cluster or S3 store where the testrunner executes the testrun.
type Executor ¶
type Executor interface { AddItem(func()) Run() }
Executor runs a set of functions in a preconfigured order
func NewExecutor ¶
func NewExecutor(log logr.Logger, config ExecutorConfig) (Executor, error)
NewExecutor creates a new function executor
type ExecutorConfig ¶
type ExecutorConfig struct { // Serial describes of the items should be executed in serial Serial bool // BackoffPeriod is the duration to wait between the creation of a bucket of testruns // 0 means that all functions are started in parallel BackoffPeriod time.Duration // BackoffBucket is the number of parallel created testruns per backoff period // 0 disables the backoff BackoffBucket int }
ExecutorConfig configures the execution order of a execution
type Rerenderer ¶
Rerenderer is instance that rerenders the current run to make it retryable.
type Run ¶
type Run struct { // Specify internal info for specific run types Info interface{} Testrun *tmv1beta1.Testrun Metadata *metadata.Metadata Error error Rerenderer Rerenderer }
Run describes a testrun that is executed by the testrunner. It consists of a testrun and its metadata
func (*Run) SetTMDashboardURL ¶
SetTMDashboardURL sets the provided dashboard URL as annotation
type RunEventFunc ¶
type RunEventFunc func(run *Run)
RunEventFunc is called every time a new testrun is triggered Also notifies for retries
type RunList ¶
type RunList []*Run
RunList represents a list of Runs.
func (RunList) GetTestruns ¶
GetTestruns returns all testruns of a RunList as testrun array
func (RunList) RenderTable ¶
RenderStatusTableForTestruns renders a status table for multiple testruns.
Directories ¶
Path | Synopsis |
---|---|
SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors
|
SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors |