result

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: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateNotificationConfigForAlerting

func GenerateNotificationConfigForAlerting(tr []*tmv1beta1.Testrun, concourseOnErrorDir string)

GenerateNotificationConfigForAlerting creates a notification config file with email recipients if any test step has failed The config file is then evaluated by Concourse

func MarkTestrunsAsUploadedToGithub

func MarkTestrunsAsUploadedToGithub(log logr.Logger, tmClient client.Client, runs testrunner.RunList) error

MarkTestrunsAsIngested sets the ingest status of testruns to true

func UploadStatusToGithub

func UploadStatusToGithub(log logr.Logger, runs testrunner.RunList, components []*componentdescriptor.Component, githubUser, githubPassword, assetPrefix string) error

uploads status results as assets to github component releases

Types

type AssetOverview

type AssetOverview struct {
	AssetOverviewItems []AssetOverviewItem
}

func DownloadAssetOverview

func DownloadAssetOverview(log logr.Logger, component ComponentExtended, overviewFilepath string) (AssetOverview, error)

DownloadAssetOverview downloads and parses the asset overview from a component from github

func (AssetOverview) Contains

func (overview AssetOverview) Contains(searchAssetName string) bool

func (AssetOverview) Get

func (overview AssetOverview) Get(assetName string) *AssetOverviewItem

type AssetOverviewItem

type AssetOverviewItem struct {
	Name       string             `json:"name"`
	Successful bool               `json:"successful"`
	Dimension  metadata.Dimension `json:"dimension,omitempty"`
}

type Collector

type Collector struct {

	// RunExecCh is called when a new testrun is executed
	RunExecCh chan *testrunner.Run
	// contains filtered or unexported fields
}

func New

func New(log logr.Logger, config Config, kubeconfig string) (*Collector, error)

func (*Collector) Collect

func (c *Collector) Collect(ctx context.Context, log logr.Logger, tmClient client.Client, namespace string, runs testrunner.RunList) ([]string, error)

Collect collects results of all testruns and writes them to a file. It returns a list with the names of failed testruns.

type ComponentExtended

type ComponentExtended struct {
	PlainURL        string
	Version         string
	GithubClient    *github.Client
	Owner           string
	Name            string
	GithubReleaseID int64
}

func EnhanceComponent

func EnhanceComponent(component *componentdescriptor.Component, githubUser string, githubPassword string) (ComponentExtended, error)

EnhanceComponent wraps component struct with additional github properties: github client, repo owner, repo name, release ID

type Config

type Config struct {
	// OutputDir is the path where the testresults are written to.
	OutputDir string

	// Path to the error directory of concourse to put the notify.cfg in.
	ConcourseOnErrorDir string

	// ComponentDescriptorPath path to the component descriptor file
	ComponentDescriptorPath string

	// Repository specifies the repository used to resolve the component references of the component specified in
	// ComponentDescriptorPath
	Repository string

	// OCMConfigPath is the path to the .ocmconfig file
	// Per default, the file is expected to be at $HOME/.ocmconfig
	OCMConfigPath string

	// AssetComponents indicates to upload the testrun status to the github component as an asset
	AssetComponents []string

	// GithubUser to allow getting a github client
	GithubUser string

	GithubPassword string

	// UploadStatusAsset states whether the testrun status should be uploaded as a github release asset
	UploadStatusAsset bool

	// AssetPrefix defines the asset name prefix
	AssetPrefix string

	// ConcourseURL provides the concourse URL as reference for testruns summary results
	ConcourseURL string

	// GrafanaURL provides the grafana dashboard URL for test results
	GrafanaURL string

	// SlackToken is the slack token for slack API operations
	SlackToken string

	// SlackChannel defines in which slack channel the testruns summary shall be posted
	SlackChannel string

	// PostSummaryInSlack states whether the summary of testruns shall be posted in slack
	PostSummaryInSlack bool
}

Config represents the configuration for collecting and storing results from a testrun.

Jump to

Keyboard shortcuts

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