v1

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: MIT Imports: 36 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the kubetest v1 API group +kubebuilder:object:generate=true +groupName=kubetest.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "kubetest.io", Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var (
	ErrFailedTestJob = xerrors.New("failed test job")
	ErrFatal         = xerrors.New("fatal error")
)

Functions

This section is empty.

Types

type ArtifactOutputPathType added in v0.4.9

type ArtifactOutputPathType string
const (
	ArtifactOutputPathContainer ArtifactOutputPathType = "container"
	ArtifactOutputPathTest      ArtifactOutputPathType = "test"
)

type ArtifactOutputSpec added in v0.4.9

type ArtifactOutputSpec struct {
	// Path path to the output artifact.
	Path string `json:"path"`
	// PathType type of intermediate directory name for output path. default type is container.
	PathType ArtifactOutputPathType `json:"pathType"`
}

func (*ArtifactOutputSpec) DeepCopy added in v0.4.9

func (in *ArtifactOutputSpec) DeepCopy() *ArtifactOutputSpec

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

func (*ArtifactOutputSpec) DeepCopyInto added in v0.4.9

func (in *ArtifactOutputSpec) DeepCopyInto(out *ArtifactOutputSpec)

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

type ArtifactsSpec added in v0.4.9

type ArtifactsSpec struct {
	// Paths all paths to the artifact.
	Paths []string `json:"paths"`
	// Output define output path for artifact.
	Output ArtifactOutputSpec `json:"output"`
}

func (*ArtifactsSpec) DeepCopy added in v0.4.9

func (in *ArtifactsSpec) DeepCopy() *ArtifactsSpec

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

func (*ArtifactsSpec) DeepCopyInto added in v0.4.9

func (in *ArtifactsSpec) DeepCopyInto(out *ArtifactsSpec)

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

type CacheSpec added in v0.2.0

type CacheSpec struct {
	// Name cache identifier
	Name string `json:"name"`
	// Command for making cache
	Command Command `json:"command"`
	// Path specify mount path
	Path string `json:"path"`
}

func (*CacheSpec) DeepCopy added in v0.2.0

func (in *CacheSpec) DeepCopy() *CacheSpec

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

func (*CacheSpec) DeepCopyInto added in v0.2.0

func (in *CacheSpec) DeepCopyInto(out *CacheSpec)

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

type Command

type Command string

type DistributedTestListSpec added in v0.2.8

type DistributedTestListSpec struct {
	// Static test names
	Names []string `json:"names"`
	// Command to get a list of tests dynamically
	Command []string `json:"command"`
	// Command arguments to get a list of tests dynamically
	Args []string `json:"args"`
	// Delimiter for testing list ( default: new line character ( \n ) )
	Delimiter string `json:"delimiter,omitempty"`
	// Test name pattern ( enable use regular expression )
	Pattern string `json:"pattern,omitempty"`
}

func (*DistributedTestListSpec) DeepCopy added in v0.2.8

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

func (*DistributedTestListSpec) DeepCopyInto added in v0.2.8

func (in *DistributedTestListSpec) DeepCopyInto(out *DistributedTestListSpec)

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

type DistributedTestSpec

type DistributedTestSpec struct {
	// ContainerName container name for running test in template.spec.containers.
	ContainerName string `json:"containerName"`
	// MaxContainersPerPod maximum number of container per pod.
	MaxContainersPerPod int `json:"maxContainersPerPod"`
	// MaxConcurrentNumPerPod maximum number of concurrent per pod.
	MaxConcurrentNumPerPod int `json:"maxConcurrentNumPerPod"`
	// Output testing list to stdout
	List DistributedTestListSpec `json:"list"`
	// Restart testing for failed tests
	Retest bool `json:"retest,omitempty"`
	// CacheSpec for making cache before testing
	Cache []CacheSpec `json:"cache,omitempty"`
	// Artifacts for manipulating test artifacts.
	Artifacts *ArtifactsSpec `json:"artifacts,omitempty"`
}

func (*DistributedTestSpec) DeepCopy

func (in *DistributedTestSpec) DeepCopy() *DistributedTestSpec

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

func (*DistributedTestSpec) DeepCopyInto

func (in *DistributedTestSpec) DeepCopyInto(out *DistributedTestSpec)

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

type GitHubAppTokenSpec added in v0.5.5

type GitHubAppTokenSpec struct {
	Organization   string                    `json:"organization,omitempty"`
	AppID          int64                     `json:"appId"`
	InstallationID int64                     `json:"installationId,omitempty"`
	KeyFile        *corev1.SecretKeySelector `json:"keyFile"`
}

func (*GitHubAppTokenSpec) DeepCopy added in v0.5.5

func (in *GitHubAppTokenSpec) DeepCopy() *GitHubAppTokenSpec

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

func (*GitHubAppTokenSpec) DeepCopyInto added in v0.5.5

func (in *GitHubAppTokenSpec) DeepCopyInto(out *GitHubAppTokenSpec)

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

type GitMergeSpec added in v0.3.0

type GitMergeSpec struct {
	// Base branch name
	Base string `json:"base"`
}

func (*GitMergeSpec) DeepCopy added in v0.3.0

func (in *GitMergeSpec) DeepCopy() *GitMergeSpec

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

func (*GitMergeSpec) DeepCopyInto added in v0.3.0

func (in *GitMergeSpec) DeepCopyInto(out *GitMergeSpec)

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

type GitSpec added in v0.2.8

type GitSpec struct {
	// Image name for clone and checkout by git protocol.
	Image string `json:"image,omitempty"`
	// Checkout whether checkout repository before testing ( default: true ).
	Checkout *bool `json:"checkout,omitempty"`
	// Repository name.
	Repo string `json:"repo"`
	// Branch name.
	Branch string `json:"branch,omitempty"`
	// Revision.
	Rev string `json:"rev,omitempty"`
	// OAuth token to fetch private repository
	Token *TestJobToken `json:"token,omitempty"`
	// CheckoutDir ( default: /git/workspace )
	CheckoutDir string `json:"checkoutDir,omitempty"`
	// Merge base branch
	Merge GitMergeSpec `json:"merge,omitempty"`
}

func (*GitSpec) DeepCopy added in v0.2.8

func (in *GitSpec) DeepCopy() *GitSpec

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

func (*GitSpec) DeepCopyInto added in v0.2.8

func (in *GitSpec) DeepCopyInto(out *GitSpec)

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

type LogSpec added in v0.2.8

type LogSpec struct {
	ExtParam map[string]string `json:"extParam"`
}

func (*LogSpec) DeepCopy added in v0.2.8

func (in *LogSpec) DeepCopy() *LogSpec

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

func (*LogSpec) DeepCopyInto added in v0.2.8

func (in *LogSpec) DeepCopyInto(out *LogSpec)

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

type PrepareSpec

type PrepareSpec struct {
	// Checkout whether checkout repository before testing ( default: true ).
	Checkout *bool             `json:"checkout,omitempty"`
	Image    string            `json:"image"`
	Steps    []PrepareStepSpec `json:"steps"`
}

func (*PrepareSpec) DeepCopy

func (in *PrepareSpec) DeepCopy() *PrepareSpec

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

func (*PrepareSpec) DeepCopyInto

func (in *PrepareSpec) DeepCopyInto(out *PrepareSpec)

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

type PrepareStepSpec

type PrepareStepSpec struct {
	Name    string  `json:"name"`
	Image   string  `json:"image,omitempty"`
	Command Command `json:"command"`
	// Workdir ( default: /git/workspace )
	Workdir string          `json:"workdir,omitempty"`
	Env     []corev1.EnvVar `json:"env,omiempty"`
}

func (*PrepareStepSpec) DeepCopy

func (in *PrepareStepSpec) DeepCopy() *PrepareStepSpec

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

func (*PrepareStepSpec) DeepCopyInto

func (in *PrepareStepSpec) DeepCopyInto(out *PrepareStepSpec)

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

type TestJob

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

	Spec   TestJobSpec   `json:"spec,omitempty"`
	Status TestJobStatus `json:"status,omitempty"`
}

TestJob is the Schema for the testjobs API

func (*TestJob) DeepCopy

func (in *TestJob) DeepCopy() *TestJob

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

func (*TestJob) DeepCopyInto

func (in *TestJob) DeepCopyInto(out *TestJob)

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

func (*TestJob) DeepCopyObject

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

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

type TestJobList

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

TestJobList contains a list of TestJob

func (*TestJobList) DeepCopy

func (in *TestJobList) DeepCopy() *TestJobList

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

func (*TestJobList) DeepCopyInto

func (in *TestJobList) DeepCopyInto(out *TestJobList)

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

func (*TestJobList) DeepCopyObject

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

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

type TestJobRunner

type TestJobRunner struct {
	// contains filtered or unexported fields
}

func NewTestJobRunner

func NewTestJobRunner(config *rest.Config) (*TestJobRunner, error)

func (*TestJobRunner) DisableCommandLog

func (r *TestJobRunner) DisableCommandLog()

func (*TestJobRunner) DisablePrepareLog

func (r *TestJobRunner) DisablePrepareLog()

func (*TestJobRunner) DisableResultLog added in v0.2.0

func (r *TestJobRunner) DisableResultLog()

func (*TestJobRunner) EnableVerboseLog added in v0.4.5

func (r *TestJobRunner) EnableVerboseLog()

func (*TestJobRunner) Run

func (r *TestJobRunner) Run(ctx context.Context, testjob TestJob) error

func (*TestJobRunner) SetLogger

func (r *TestJobRunner) SetLogger(logger func(*kubejob.ContainerLog))

func (*TestJobRunner) SetToken

func (r *TestJobRunner) SetToken(token string)

type TestJobSecretKeyRef

type TestJobSecretKeyRef struct {
	Name string `json:"name"`
	Key  string `json:"key"`
}

func (*TestJobSecretKeyRef) DeepCopy

func (in *TestJobSecretKeyRef) DeepCopy() *TestJobSecretKeyRef

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

func (*TestJobSecretKeyRef) DeepCopyInto

func (in *TestJobSecretKeyRef) DeepCopyInto(out *TestJobSecretKeyRef)

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

type TestJobSpec

type TestJobSpec struct {
	Git      GitSpec                `json:"git,omitempty"`
	Template corev1.PodTemplateSpec `json:"template"`
	// Log extend parameter to output log.
	Log LogSpec `json:"log,omitempty"`
	// Prepare steps before testing
	Prepare PrepareSpec `json:"prepare,omitempty"`
	// Distributed testing parameter
	DistributedTest *DistributedTestSpec `json:"distributedTest,omitempty"`
}

TestJobSpec defines the desired state of TestJob

func (*TestJobSpec) DeepCopy

func (in *TestJobSpec) DeepCopy() *TestJobSpec

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

func (*TestJobSpec) DeepCopyInto

func (in *TestJobSpec) DeepCopyInto(out *TestJobSpec)

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

type TestJobStatus

type TestJobStatus struct {

	// Whether the testjob is running
	Running bool `json:"running,omitempty"`
}

TestJobStatus defines the observed state of TestJob

func (*TestJobStatus) DeepCopy

func (in *TestJobStatus) DeepCopy() *TestJobStatus

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

func (*TestJobStatus) DeepCopyInto

func (in *TestJobStatus) DeepCopyInto(out *TestJobStatus)

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

type TestJobToken

type TestJobToken struct {
	GitHubApp   *GitHubAppTokenSpec       `json:"githubApp,omitempty"`
	GitHubToken *corev1.SecretKeySelector `json:"githubToken,omitempty"`
	Token       *corev1.SecretKeySelector `json:"secretKeyRef,omitempty"`
}

func (*TestJobToken) AccessToken added in v0.5.5

func (t *TestJobToken) AccessToken(ctx context.Context, cli *tokenClient) (string, error)

func (*TestJobToken) DeepCopy

func (in *TestJobToken) DeepCopy() *TestJobToken

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

func (*TestJobToken) DeepCopyInto

func (in *TestJobToken) DeepCopyInto(out *TestJobToken)

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

type TestLog added in v0.2.4

type TestLog struct {
	Name           string                  `json:"name"`
	TestResult     TestResult              `json:"testResult"`
	ElapsedTimeSec int                     `json:"elapsedTimeSec"`
	Message        *kubetest.MaskedMessage `json:"-"`
}

type TestResult added in v0.2.4

type TestResult string
const (
	// TestResultSuccess represents that all test cases have passed.
	TestResultSuccess TestResult = "success"
	// TestResultFailure represents failed test case exists.
	TestResultFailure TestResult = "failure"
	// TestResultError is unexpected internal error.
	TestResultError TestResult = "error"
)

type TestResultLog added in v0.2.0

type TestResultLog struct {
	TestResult     TestResult          `json:"testResult"`
	Job            string              `json:"job"`
	ElapsedTimeSec int                 `json:"elapsedTimeSec"`
	StartedAt      time.Time           `json:"startedAt"`
	Details        TestResultLogDetail `json:"details"`
}

type TestResultLogDetail added in v0.2.0

type TestResultLogDetail struct {
	Tests []*TestLog `json:"tests"`
}

Jump to

Keyboard shortcuts

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