load

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BuildrunCompletionTime = "BuildRun completion time"
	BuildrunControlTime    = "BuildRun control time"
	TaskrunCompletionTime  = "TaskRun completion time"
	TaskrunControlTime     = "TaskRun control time"
	PodCompletionTime      = "Pod completion time"
	PodControlTime         = "Pod control time"
	BuildRegistrationTime  = "Build registration time"
)

Naming constants for the results

Variables

View Source
var Debug bool

Debug enables or disables additional output

Functions

func CheckSystemAndConfig

func CheckSystemAndConfig(kubeAccess KubeAccess, buildCfg BuildConfig, parallel int) error

CheckSystemAndConfig sanity checks the cluster using the provided buildrun settings to verify whether a buildrun can work and how much pressure it would put onto the system

func CreateBuildrunResultsChartJS added in v0.4.1

func CreateBuildrunResultsChartJS(data []Result, w io.Writer) error

CreateBuildrunResultsChartJS creates a page with ChartJS to display the results of buildruns

func CreateChartJS

func CreateChartJS(data []ResultSet, w io.Writer) error

CreateChartJS creates a page with ChartsJS to render the provided results

func CreateResultSetCSV added in v0.5.0

func CreateResultSetCSV(data []ResultSet, w io.Writer) error

CreateResultSetCSV creates a comma separated values (CSV) content based on the result sets

func CreateResultsCSV added in v0.5.0

func CreateResultsCSV(data []Result, w io.Writer) error

CreateResultsCSV creates a comma separated values (CSV) content based on the buildruns

func ExecuteTestPlan added in v0.2.0

func ExecuteTestPlan(kubeAccess KubeAccess, testplan TestPlan) error

ExecuteTestPlan executes the given test plan step by step

Types

type BuildConfig added in v0.3.0

type BuildConfig struct {
	ClusterBuildStrategy       string
	SourceURL                  string
	SourceRevision             string
	SourceContextDir           string
	SourceSecretRef            string
	SourceDockerfile           string
	ServiceAccountName         string
	OutputImageURL             string
	OutputSecretRef            string
	Timeout                    time.Duration
	SkipDelete                 bool
	SkipVerifySourceRepository bool
}

BuildConfig contains all fields required to setup a buildRun

type BuildRunOption added in v0.3.6

type BuildRunOption func(*buildRunOptions)

BuildRunOption specifies optional settings for a buildrun

func ServiceAccountName added in v0.8.0

func ServiceAccountName(value string) BuildRunOption

ServiceAccountName sets the service account to be used, use empty string to generate one

func SkipDelete added in v0.3.6

func SkipDelete(value bool) BuildRunOption

SkipDelete sets whether or not the resources like build, buildrun and output image should be cleaned up

type KubeAccess

type KubeAccess struct {
	Context      context.Context
	RestConfig   *rest.Config
	Client       kubernetes.Interface
	BuildClient  buildclient.Interface
	TektonClient tektonclient.Interface
}

KubeAccess contains Kubernetes cluster access objects in a single place

func NewKubeAccess

func NewKubeAccess() (*KubeAccess, error)

NewKubeAccess creates a new kubernetes access handle

type NamingConfig added in v0.3.0

type NamingConfig struct {
	Namespace string
	Prefix    string
}

NamingConfig contains all fields required for proper naming of buildRuns

type Result added in v0.5.0

type Result []Value

Result contains the raw time results

func ExecuteBuilds added in v0.5.0

func ExecuteBuilds(kubeAccess KubeAccess, namingCfg NamingConfig, buildCfg BuildConfig, count int) ([]Result, error)

ExecuteBuilds creates a number of builds and waits for them to be registered

func ExecuteParallelBuildRuns

func ExecuteParallelBuildRuns(kubeAccess KubeAccess, namingCfg NamingConfig, buildCfg BuildConfig, parallel int) ([]Result, error)

ExecuteParallelBuildRuns executes the same buildrun multiple times in parallel

func ExecuteSingleBuildRun

func ExecuteSingleBuildRun(kubeAccess KubeAccess, namespace string, name string, buildSpec buildv1alpha1.BuildSpec, buildAnnotations map[string]string, options ...BuildRunOption) (*Result, error)

ExecuteSingleBuildRun executes a single buildrun based on the given settings

func (Result) String added in v0.5.0

func (brr Result) String() string

func (Result) ValueOf added in v0.5.0

func (brr Result) ValueOf(description string) time.Duration

ValueOf returns the value that matches with the given description

type ResultSet added in v0.5.0

type ResultSet struct {
	EntityType string

	NumberOfResults int

	Minimum Result
	Maximum Result
	Mean    Result
	Median  Result
}

ResultSet is an aggregated result set based on multiple results

func CalculateResultSet added in v0.5.0

func CalculateResultSet(results []Result, entityType string) ResultSet

CalculateResultSet creates a result set using a list of results to get the minimum, mean, median, and maximum results

func ExecuteSeriesOfParallelBuildRuns

func ExecuteSeriesOfParallelBuildRuns(kubeAccess KubeAccess, namingCfg NamingConfig, buildCfg BuildConfig, start int, end int, increment int) ([]ResultSet, error)

ExecuteSeriesOfParallelBuildRuns executes a series of parallel buildruns increasing the number of parallel buildruns with each interation

func (ResultSet) String added in v0.5.0

func (rs ResultSet) String() string

type TestPlan added in v0.2.0

type TestPlan struct {
	Namespace          string `yaml:"namespace" json:"namespace"`
	ServiceAccountName string `yaml:"serviceAccountName" json:"serviceAccountName"`
	Steps              []struct {
		Name             string                 `yaml:"name" json:"name"`
		BuildAnnotations map[string]string      `yaml:"buildAnnotations" json:"buildAnnotations"`
		BuildSpec        buildv1alpha.BuildSpec `yaml:"buildSpec" json:"buildSpec"`
	} `yaml:"steps" json:"steps"`
}

TestPlan is a plan with steps that define tests

func NewTestPlan added in v0.3.0

func NewTestPlan(in io.Reader) (*TestPlan, error)

NewTestPlan creates a test plan based on the provided input

type Value added in v0.3.5

type Value struct {
	Description string
	Value       time.Duration
}

Value describes a time duration with a description (explanation)

Jump to

Keyboard shortcuts

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