Documentation ¶
Index ¶
- Constants
- Variables
- func CheckSystemAndConfig(kubeAccess KubeAccess, buildCfg BuildConfig, parallel int) error
- func CreateBuildRunResultSetCSV(data []BuildRunResultSet, w io.Writer) error
- func CreateBuildRunResultsCSV(data []BuildRunResult, w io.Writer) error
- func CreateBuildrunResultsChartJS(data []BuildRunResult, w io.Writer) error
- func CreateChartJS(data []BuildRunResultSet, w io.Writer) error
- func ExecuteTestPlan(kubeAccess KubeAccess, testplan TestPlan) error
- type BuildConfig
- type BuildRunOption
- type BuildRunResult
- type BuildRunResultSet
- type KubeAccess
- type NamingConfig
- type TestPlan
- type Value
Constants ¶
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" )
Naming constants for the buildrun results
Variables ¶
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 CreateBuildRunResultSetCSV ¶ added in v0.3.7
func CreateBuildRunResultSetCSV(data []BuildRunResultSet, w io.Writer) error
CreateBuildRunResultSetCSV creates a comma separated values (CSV) content based on the buildrun result sets
func CreateBuildRunResultsCSV ¶ added in v0.4.1
func CreateBuildRunResultsCSV(data []BuildRunResult, w io.Writer) error
CreateBuildRunResultsCSV creates a comma separated values (CSV) content based on the buildruns
func CreateBuildrunResultsChartJS ¶ added in v0.4.1
func CreateBuildrunResultsChartJS(data []BuildRunResult, w io.Writer) error
CreateBuildrunResultsChartJS creates a page with ChartJS to display the results of buildruns
func CreateChartJS ¶
func CreateChartJS(data []BuildRunResultSet, w io.Writer) error
CreateChartJS creates a page with ChartsJS to render the provided results
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 GenerateServiceAccount bool OutputImageURL string OutputSecretRef string Timeout time.Duration SkipDelete 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 GenerateServiceAccount ¶ added in v0.3.6
func GenerateServiceAccount(value bool) BuildRunOption
GenerateServiceAccount sets whether or not a service account is created for the buildrun
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 BuildRunResult ¶
type BuildRunResult []Value
BuildRunResult contains the raw time results of a buildrun
func ExecuteParallelBuildRuns ¶
func ExecuteParallelBuildRuns(kubeAccess KubeAccess, namingCfg NamingConfig, buildCfg BuildConfig, parallel int) ([]BuildRunResult, error)
ExecuteParallelBuildRuns executes the same buildrun multiple times in parallel
func ExecuteSingleBuildRun ¶
func ExecuteSingleBuildRun(kubeAccess KubeAccess, namespace string, name string, buildSpec buildv1alpha1.BuildSpec, options ...BuildRunOption) (*BuildRunResult, error)
ExecuteSingleBuildRun executes a single buildrun based on the given settings
func (BuildRunResult) String ¶ added in v0.3.4
func (brr BuildRunResult) String() string
type BuildRunResultSet ¶
type BuildRunResultSet struct { NumberOfResults int Minimum BuildRunResult Maximum BuildRunResult Mean BuildRunResult Median BuildRunResult }
BuildRunResultSet is an aggregated result set based on multiple buildrun results
func CalculateBuildRunResultSet ¶
func CalculateBuildRunResultSet(results []BuildRunResult) BuildRunResultSet
CalculateBuildRunResultSet creates a buildrun result set using a list of buildrun 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) ([]BuildRunResultSet, error)
ExecuteSeriesOfParallelBuildRuns executes a series of parallel buildruns increasing the number of parallel buildruns with each interation
func (BuildRunResultSet) String ¶
func (brs BuildRunResultSet) String() string
type KubeAccess ¶
type KubeAccess struct { 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
NamingConfig contains all fields required for proper naming of buildRuns
type TestPlan ¶ added in v0.2.0
type TestPlan struct { Namespace string `yaml:"namespace" json:"namespace"` GenerateServiceAccount bool `yaml:"generateServiceAccount" json:"generateServiceAccount"` Steps []struct { Name string `yaml:"name" json:"name"` BuildSpec buildv1alpha.BuildSpec `yaml:"buildSpec" json:"buildSpec"` } `yaml:"steps" json:"steps"` }
TestPlan is a plan with steps that define tests