v1beta1

package
v0.0.0-...-02c6b06 Latest Latest
Warning

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

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

Documentation

Overview

Package v1beta1 is a version of the API. +groupName=testmachinery.sapcloud.io

Package v1beta1 is the v1beta1 version of the API. +k8s:deepcopy-gen=package,register +k8s:openapi-gen=true +k8s:defaulter-gen=TypeMeta +groupName=testmachinery.sapcloud.io

Index

Constants

View Source
const (
	// SeedKubeconfigName is the name of the seed kubeconfig which can be found in the TM_KUBECONFIG_PATH
	TestMachineryKubeconfigName = "testmachinery.config"

	// SeedKubeconfigName is the name of the seed kubeconfig which can be found in the TM_KUBECONFIG_PATH
	HostKubeconfigName = "host.config"

	// SeedKubeconfigName is the name of the seed kubeconfig which can be found in the TM_KUBECONFIG_PATH
	GardenerKubeconfigName = "gardener.config"

	// SeedKubeconfigName is the name of the seed kubeconfig which can be found in the TM_KUBECONFIG_PATH
	SeedKubeconfigName = "seed.config"

	// ShootKubeconfigName is the name of the shoot kubeconfig which can be found in the TM_KUBECONFIG_PATH
	ShootKubeconfigName = "shoot.config"
)
View Source
const (
	ConfigTypeEnv  = "env"
	ConfigTypeFile = "file"
)

ConfigElement types

View Source
const (
	StepPhaseInit    argov1.NodePhase = "Init"
	StepPhasePending                  = argov1.NodePending
	StepPhaseRunning                  = argov1.NodeRunning
	StepPhaseSuccess                  = argov1.NodeSucceeded
	StepPhaseSkipped                  = argov1.NodeSkipped
	StepPhaseFailed                   = argov1.NodeFailed
	StepPhaseError                    = argov1.NodeError
	StepPhaseTimeout argov1.NodePhase = "Timeout"
)

Teststep statuses

View Source
const (
	RunPhaseInit    argov1.WorkflowPhase = "Init"
	RunPhasePending                      = argov1.WorkflowPending
	RunPhaseRunning                      = argov1.WorkflowRunning
	RunPhaseSuccess                      = argov1.WorkflowSucceeded
	// RunPhaseSkipped                  = argov1.Skipped
	RunPhaseFailed                       = argov1.WorkflowFailed
	RunPhaseError                        = argov1.WorkflowError
	RunPhaseTimeout argov1.WorkflowPhase = "Timeout"
)

Testrun statuses

View Source
const (
	// SerialBehavior defines a serial behavior for the step which
	// means that the testdefinition should run in serial.
	SerialBehavior = "serial"
	// DisruptiveBehavior defines the testdefinition as disruptive
	// which means that the same properties as for serial testdefinitions apply
	// and these steps are always have the continueOnError set to false.
	DisruptiveBehavior = "disruptive"
)
View Source
const TestDefinitionName = "TestDefinition"

TestDefinitionName is the kind identifier of a testdefinition.

Variables

View Source
var (
	SchemeBuilder runtime.SchemeBuilder

	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: testmachinery.GroupName, Version: "v1beta1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func RegisterConversions

func RegisterConversions(s *runtime.Scheme) error

RegisterConversions adds conversion functions to the given scheme. Public to allow building arbitrary schemes.

func RegisterDefaults

func RegisterDefaults(scheme *runtime.Scheme) error

RegisterDefaults adds defaulters functions to the given scheme. Public to allow building arbitrary schemes. All generated defaulters are covering - they call all nested defaulters.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type ConditionType

type ConditionType string

ConditionType is the type of a testflow step indicating when it should be executed.

const (
	ConditionTypeError   ConditionType = "error"
	ConditionTypeSuccess ConditionType = "success"
	ConditionTypeAlways  ConditionType = "always"
)

Testflow step conditions

type ConfigElement

type ConfigElement struct {
	// Type of the config value. For now only environment variables are supported.
	Type ConfigType `json:"type"`

	// Name of the environment variable. Must be a C_IDENTIFIER.
	Name string `json:"name"`

	// Private indicates if the config is shared with further steps
	Private *bool `json:"private,omitempty"`

	// value of the environment variable.
	// +optional
	Value string `json:"value,omitempty"`

	// Fetches the value from a secret or configmap on the testmachinery cluster.
	// +optional
	ValueFrom *strconf.ConfigSource `json:"valueFrom,omitempty"`

	// Only for type=file. Path where the file should be mounted.
	// +optional
	Path string `json:"path,omitempty"`
}

ConfigElement is a parameter of a certain type which is passed to TestDefinitions.

func (*ConfigElement) DeepCopy

func (in *ConfigElement) DeepCopy() *ConfigElement

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigElement.

func (*ConfigElement) DeepCopyInto

func (in *ConfigElement) DeepCopyInto(out *ConfigElement)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ConfigType

type ConfigType string

ConfigType is the type of a ConfigElement.

type DAGStep

type DAGStep struct {
	Name               string            `json:"name,omitempty"`
	Definition         StepDefinition    `json:"definition,omitempty"`
	UseGlobalArtifacts bool              `json:"useGlobalArtifacts,omitempty"`
	DependsOn          []string          `json:"dependsOn,omitempty"`
	ArtifactsFrom      string            `json:"artifactsFrom,omitempty"`
	Pause              *Pause            `json:"pause,omitempty"`
	Annotations        map[string]string `json:"annotations,omitempty"`
}

func (*DAGStep) DeepCopy

func (in *DAGStep) DeepCopy() *DAGStep

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DAGStep.

func (*DAGStep) DeepCopyInto

func (in *DAGStep) DeepCopyInto(out *DAGStep)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocationSet

type LocationSet struct {
	// Unique name of the set.
	Name string `json:"name,omitempty"`
	// default defines this location set as the default location set to search for TestDefinitions.
	// Only one default location per Testrun is possible.
	// +optional
	Default bool `json:"default,omitempty"`
	// Locations defines all Locations corresponding to the set.
	Locations []TestLocation `json:"locations,omitempty"`
}

LocationSet defines a set of locations with a specific name and a flag marking the set as the default set.

func (*LocationSet) DeepCopy

func (in *LocationSet) DeepCopy() *LocationSet

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocationSet.

func (*LocationSet) DeepCopyInto

func (in *LocationSet) DeepCopyInto(out *LocationSet)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocationType

type LocationType string

LocationType is the type of a TestDef location.

const (
	LocationTypeGit     LocationType = "git"
	LocationTypeLocal   LocationType = "local"
	LocationTypeUnknown LocationType = "unknown"
)

Testdefinition location types

func GetLocationType

func GetLocationType(locationType string) (LocationType, error)

GetLocationType returns the LocationType constant for the given string. Returns LocationTypeUnknown and an error if the given string did not match any known location type.

type Pause

type Pause struct {
	// pauses before this step is executed
	Enabled bool `json:"enabled,omitempty"`

	// Resumes the workflow after specified time if it is not manually resumed
	// +optional
	ResumeTimeoutSeconds *int `json:"resumeTimeoutSeconds,omitempty"`
}

func (*Pause) DeepCopy

func (in *Pause) DeepCopy() *Pause

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pause.

func (*Pause) DeepCopyInto

func (in *Pause) DeepCopyInto(out *Pause)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StepDefinition

type StepDefinition struct {
	Name  string `json:"name,omitempty"`
	Label string `json:"label,omitempty"`

	// Continue the execution of the workflow even when the step errors or fails.
	ContinueOnError bool `json:"continueOnError,omitempty"`

	// Condition when the step should be executed.
	// Only used if the step is in the onExit testflow.
	// +optional
	Condition ConditionType `json:"condition,omitempty"`

	// Step specific configuration.
	Config []ConfigElement `json:"config,omitempty"`

	// Name of the configset to look for testDefinitions.
	// If this is empty the default location set is used
	// +optional
	LocationSet *string `json:"locationSet,omitempty"`

	// Untrusted describes whether the step runs a trusted workload.
	// +optional
	Untrusted bool `json:"untrusted,omitempty"`
}

StepDefinition is a reference to one or more TestDefinitions to execute in a series of steps.StepDefinition

func (*StepDefinition) DeepCopy

func (in *StepDefinition) DeepCopy() *StepDefinition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepDefinition.

func (*StepDefinition) DeepCopyInto

func (in *StepDefinition) DeepCopyInto(out *StepDefinition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StepStatus

type StepStatus struct {
	Name              string                   `json:"name"`
	Position          StepStatusPosition       `json:"position"`
	TestDefinition    StepStatusTestDefinition `json:"testdefinition,omitempty"`
	Annotations       map[string]string        `json:"annotations,omitempty"`
	Phase             argov1.NodePhase         `json:"phase,omitempty"`
	StartTime         *metav1.Time             `json:"startTime,omitempty"`
	CompletionTime    *metav1.Time             `json:"completionTime,omitempty"`
	Duration          int64                    `json:"duration,omitempty"`
	ExportArtifactKey string                   `json:"exportArtifactKey"`
	PodName           string                   `json:"podName"`
}

StepStatus is the status of Testflow step

func (*StepStatus) DeepCopy

func (in *StepStatus) DeepCopy() *StepStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepStatus.

func (*StepStatus) DeepCopyInto

func (in *StepStatus) DeepCopyInto(out *StepStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StepStatusPosition

type StepStatusPosition struct {
	DependsOn []string `json:"dependsOn,omitempty"`
	Flow      string   `json:"flow,omitempty"`
	Step      string   `json:"step,omitempty"`
}

func (*StepStatusPosition) DeepCopy

func (in *StepStatusPosition) DeepCopy() *StepStatusPosition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepStatusPosition.

func (*StepStatusPosition) DeepCopyInto

func (in *StepStatusPosition) DeepCopyInto(out *StepStatusPosition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StepStatusTestDefinition

type StepStatusTestDefinition struct {
	Name                  string              `json:"name,omitempty"`
	Location              TestLocation        `json:"location,omitempty"`
	Config                []*ConfigElement    `json:"config,omitempty"`
	Labels                []string            `json:"labels,omitempty"`
	Owner                 string              `json:"owner,omitempty"`
	RecipientsOnFailure   []string            `json:"recipientsOnFailure"`
	ActiveDeadlineSeconds *intstr.IntOrString `json:"activeDeadlineSeconds"`
}

StepStatusTestDefinition holds information about the used testdefinition and its location.

func (*StepStatusTestDefinition) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepStatusTestDefinition.

func (*StepStatusTestDefinition) DeepCopyInto

func (in *StepStatusTestDefinition) DeepCopyInto(out *StepStatusTestDefinition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TestDefSpec

type TestDefSpec struct {
	// Email address of the test responsible
	// +optional
	Owner string `json:"owner,omitempty"`
	// List of additional test alerting recipients
	// +optional
	RecipientsOnFailure []string `json:"recipientsOnFailure,omitempty"`
	// Short description of the test
	// +optional
	Description string `json:"description,omitempty"`
	// Labels the test to be referenced by testruns
	// +optional
	Labels []string `json:"labels,omitempty"`
	// Specific behavior inside the test which will be respected by the testmachinery.
	// Available values: "serial"
	// +optional
	Behavior []string `json:"behavior,omitempty"`
	// Optional duration in seconds the test may be active on the node relative to
	// StartTime before the system will actively try to mark it failed and kill associated containers.
	// Value must be a positive integer.
	// +optional
	ActiveDeadlineSeconds *intstr.IntOrString `json:"activeDeadlineSeconds,omitempty"`
	// Entrypoint array. Not executed within a shell.
	// The docker image's ENTRYPOINT is used if this is not provided.
	// +optional
	Command []string `json:"command,omitempty"`
	// Arguments to the entrypoint.
	// The docker image's CMD is used if this is not provided.
	// +optional
	Args []string `json:"args,omitempty"`
	// Docker image name.
	// Defaulted to the testmachinery base image.
	// +optional
	Image string `json:"image,omitempty"`
	// TestDefinition default configuration like secrets or ConfigMaps
	// +optional
	Config []ConfigElement `json:"config,omitempty"`
	// Compute Resources required by this container.
	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`
}

TestDefSpec is the actual description of the test.

func (*TestDefSpec) DeepCopy

func (in *TestDefSpec) DeepCopy() *TestDefSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestDefSpec.

func (*TestDefSpec) DeepCopyInto

func (in *TestDefSpec) DeepCopyInto(out *TestDefSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TestDefinition

type TestDefinition struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec TestDefSpec `json:"spec"`
}

TestDefinition describes the execution of a test. +k8s:openapi-gen=true

func (*TestDefinition) DeepCopy

func (in *TestDefinition) DeepCopy() *TestDefinition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestDefinition.

func (*TestDefinition) DeepCopyInto

func (in *TestDefinition) DeepCopyInto(out *TestDefinition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TestDefinition) DeepCopyObject

func (in *TestDefinition) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TestDefinitionList

type TestDefinitionList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []TestDefinition `json:"items"`
}

TestDefinitionList contains a list of TestDefinitions

func (*TestDefinitionList) DeepCopy

func (in *TestDefinitionList) DeepCopy() *TestDefinitionList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestDefinitionList.

func (*TestDefinitionList) DeepCopyInto

func (in *TestDefinitionList) DeepCopyInto(out *TestDefinitionList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TestDefinitionList) DeepCopyObject

func (in *TestDefinitionList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TestFlow

type TestFlow []*DAGStep

TestFlow is a 2 dimensional array of testflow-steps which define the execution order of TestDefinitions.

func (TestFlow) DeepCopy

func (in TestFlow) DeepCopy() TestFlow

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestFlow.

func (TestFlow) DeepCopyInto

func (in TestFlow) DeepCopyInto(out *TestFlow)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TestLocation

type TestLocation struct {
	Type LocationType `json:"type"`
	// Only for LocationType git
	// +optional
	Repo string `json:"repo,omitempty"`
	// +optional
	Revision string `json:"revision,omitempty"`
	// The absolute host on the minikube VM.
	// Only for local
	// +optional
	HostPath string `json:"hostPath,omitempty"`
}

TestLocation describes a location to search for TestDefinitions.

func (*TestLocation) DeepCopy

func (in *TestLocation) DeepCopy() *TestLocation

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestLocation.

func (*TestLocation) DeepCopyInto

func (in *TestLocation) DeepCopyInto(out *TestLocation)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Testrun

type Testrun struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   TestrunSpec   `json:"spec"`
	Status TestrunStatus `json:"status"`
}

Testrun is the description of the testflow that should be executed. +k8s:openapi-gen=true

func (*Testrun) DeepCopy

func (in *Testrun) DeepCopy() *Testrun

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Testrun.

func (*Testrun) DeepCopyInto

func (in *Testrun) DeepCopyInto(out *Testrun)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Testrun) DeepCopyObject

func (in *Testrun) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TestrunKubeconfigs

type TestrunKubeconfigs struct {
	Host     *strconf.StringOrConfig `json:"host,omitempty"`
	Gardener *strconf.StringOrConfig `json:"gardener,omitempty"`
	Seed     *strconf.StringOrConfig `json:"seed,omitempty"`
	Shoot    *strconf.StringOrConfig `json:"shoot,omitempty"`
}

TestrunKubeconfigs are parameters where Shoot, Seed or a Gardener strconf for the Testrun can be specified.

func (*TestrunKubeconfigs) DeepCopy

func (in *TestrunKubeconfigs) DeepCopy() *TestrunKubeconfigs

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestrunKubeconfigs.

func (*TestrunKubeconfigs) DeepCopyInto

func (in *TestrunKubeconfigs) DeepCopyInto(out *TestrunKubeconfigs)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TestrunList

type TestrunList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Testrun `json:"items"`
}

TestrunList contains a list of Testruns

func (*TestrunList) DeepCopy

func (in *TestrunList) DeepCopy() *TestrunList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestrunList.

func (*TestrunList) DeepCopyInto

func (in *TestrunList) DeepCopyInto(out *TestrunList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TestrunList) DeepCopyObject

func (in *TestrunList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TestrunSpec

type TestrunSpec struct {
	Creator string `json:"creator,omitempty"`

	TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"`

	// TestLocation define repositories to look for TestDefinitions that are then executed in a workflow as specified in testflow.
	// DEPRECATED: This field will be removed in a future version.
	// +optional
	TestLocations []TestLocation `json:"testLocations,omitempty"`

	// LocationSet define location profiles with repositories to look for TestDefinitions.
	// +optional
	LocationSets []LocationSet `json:"locationSets,omitempty"`

	// Base64 encoded kubeconfigs that are mounted to every testflow step.
	// They are available at $TM_KUBECONFIG_PATH/xxx.config, where xxx is either (gardener, seed or shoot).
	// +optional
	Kubeconfigs TestrunKubeconfigs `json:"kubeconfigs,omitempty"`

	// Global config which is available to all tests in the testflow and onExit flow.
	// +optional
	Config []ConfigElement `json:"config,omitempty"`

	TestFlow TestFlow `json:"testflow,omitempty"`

	// OnExit flow is called when the test is completed.
	// +optional
	OnExit TestFlow `json:"onExit,omitempty"`
}

TestrunSpec is the specification of a Testrun.

func (*TestrunSpec) DeepCopy

func (in *TestrunSpec) DeepCopy() *TestrunSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestrunSpec.

func (*TestrunSpec) DeepCopyInto

func (in *TestrunSpec) DeepCopyInto(out *TestrunSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TestrunStatus

type TestrunStatus struct {
	// Phase is the summary of all executed steps.
	Phase argov1.WorkflowPhase `json:"phase,omitempty"`

	// State is a string that represents the actual state and/or process of the testrun.
	State string `json:"state,omitempty"`

	// StartTime is the time when the argo workflow starts executing the steps.
	StartTime *metav1.Time `json:"startTime,omitempty"`

	// CompletionTime is the time when the argo workflow is completed.
	CompletionTime *metav1.Time `json:"completionTime,omitempty"`

	// Duration represents the overall duration of the argo workflow.
	// This value is calculated by (CompletionTime - StartTime)
	Duration int64 `json:"duration,omitempty"`

	// Workflow is the name of the generated argo workflow
	Workflow string `json:"workflow,omitempty"`

	// Steps is the detailed summary of every step.
	// It also shows all specific executed tests.
	Steps []*StepStatus `json:"steps,omitempty"`

	// Collected indicates if the testrun's results were successfully collected by the testmachinery
	// +optional
	Collected bool `json:"collected,omitempty"`

	// ObservedGeneration is the most recent generation observed for this testrun.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

TestrunStatus is the status of the Testrun.

func (*TestrunStatus) DeepCopy

func (in *TestrunStatus) DeepCopy() *TestrunStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestrunStatus.

func (*TestrunStatus) DeepCopyInto

func (in *TestrunStatus) DeepCopyInto(out *TestrunStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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