testmachinery

package
v0.0.0-...-7d92a45 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// TM_KUBECONFIG_PATH is the name of the environment variable that holds the kubeconfigs folder path
	TM_KUBECONFIG_PATH_NAME = "TM_KUBECONFIG_PATH"

	// TM_KUBECONFIG_PATH is the path where kubeconfigs are mounted to tests.
	TM_KUBECONFIG_PATH = "/tmp/tm/kubeconfig"

	// TM_SHARED_PATH_NAME is the name of the environment variable that holds the shared folder path
	TM_SHARED_PATH_NAME = "TM_SHARED_PATH"

	// TM_SHARED_PATH is the path to a shared folder, where content is shared among the workflow steps
	TM_SHARED_PATH = "/tmp/tm/shared"

	// TM_REPO_PATH is the name of the environment variable that holds the repo path
	TM_REPO_PATH_NAME = "TM_REPO_PATH"

	// TM_REPO_PATH is the path where the repo/location is mounted to the tests.
	TM_REPO_PATH = "/src"

	// TM_PHASE_NAME is the name of the environment variable that holds the Test Machinery phase
	TM_PHASE_NAME = "TM_PHASE"

	// TM_EXPORT_PATH is the name of the environment variable that holds the path to the export folder
	TM_EXPORT_PATH_NAME = "TM_EXPORT_PATH"

	// TM_EXPORT_PATH is the path where test results json's are placed to be persisted.
	TM_EXPORT_PATH = "/tmp/tm/export"

	// ExportArtifact is the name of the output artifact where results are stored.
	ExportArtifact = "ExportArtifact"

	// TM_TESTRUN_ID_NAME is the name of the environment variable that holds the current testrun id
	TM_TESTRUN_ID_NAME = "TM_TESTRUN_ID"

	// TM_GIT_SHA_NAME is the name of the environment variable that holds the current git commit sha of the specified location.
	TM_GIT_SHA_NAME = "TM_GIT_SHA"

	// TM_GIT_REF_NAME is the name of the environment variable that holds the current git ref of the specified location.
	TM_GIT_REF_NAME = "TM_GIT_REF"

	// ConfigMapName is the name of the testmachinery configmap in the cluster
	ConfigMapName = "tm-config"

	// the label and taint of the nodes in the worker pool which are preferably used for workflow pods
	WorkerPoolTaintLabelName = "testload"

	// Name of the argo suspend template name
	PauseTemplateName = "suspend"

	// ArtifactKubeconfigs is the name of the kubeconfigs artifact
	ArtifactKubeconfigs = "kubeconfigs"

	// ArtifactUntrustedKubeconfigs is the name of the kubeconfigs artifacts for untrusted steps
	ArtifactUntrustedKubeconfigs = "untrustedKubeconfigs"

	// ArtifactSharedFolder is the name of the shared folder artifact
	ArtifactSharedFolder = "sharedFolder"
)

Variables

View Source
var ConfigScheme = runtime.NewScheme()

ConfigScheme is the core testmachinery scheme

View Source
var TestMachineryScheme = runtime.NewScheme()

TestMachineryScheme is the scheme used in the testmachinery and testrunner.

Functions

func BaseImage

func BaseImage() string

BaseImage returns the default image that is used if no image is specified by a TestDefinition.

func CleanWorkflowPods

func CleanWorkflowPods() bool

CleanWorkflowPods returns whether pod gc is enabled.

func GetElasticsearchConfiguration

func GetElasticsearchConfiguration() *config.ElasticSearch

GetElasticsearchConfiguration returns the current elasticsearch configuration

func GetLandscapeMappings

func GetLandscapeMappings() []config.LandscapeMapping

func GetNamespace

func GetNamespace() string

GetNamespace returns the current testmachinery namespace.

func GetPauseTaskName

func GetPauseTaskName(name string) string

GetPauseTaskName returns the name of the pause step to a corresponding step.

func GetRetryTimeout

func GetRetryTimeout() *time.Duration

GetRetryTimeout returns the retry

func GetS3Configuration

func GetS3Configuration() *config.S3

GetS3Configuration returns the current s3 configuration

func GetWorkflowName

func GetWorkflowName(tr *tmv1beta1.Testrun) string

GetWorkflowName returns the workflow name of a testruns

func IsRunInsecure

func IsRunInsecure() bool

IsRunInsecure returns if the testmachinery is run locally

func IsRunLocal

func IsRunLocal() bool

IsRunLocal returns if the testmachinery is currently running locally

func Locations

func Locations() config.Locations

Locations returns the locations configuration

func ParseTestrun

func ParseTestrun(data []byte) (*v1beta1.Testrun, error)

ParseTestrun parses testrun.

func ParseTestrunFromFile

func ParseTestrunFromFile(file string) (*v1beta1.Testrun, error)

ParseTestrunFromFile reads a testrun.yaml file from file and parses the yaml.

func PrepareImage

func PrepareImage() string

Prepare Image returns the image of the prepare step.

func Setup

func Setup(config *config.Configuration) error

Setup fetches all configuration values and creates the TmConfiguration.

func TestDefPath

func TestDefPath() string

TestDefPath returns the path to TestDefinition inside repositories (scripts/integration-tests/argo/tm).

Types

type GitHubConfig

type GitHubConfig struct {
	Cache   *config.GitHubCache
	Secrets []GitHubInstanceConfig
}

GitHub represents the github configuration for the testmachinery

type GitHubInstanceConfig

type GitHubInstanceConfig struct {
	HttpUrl       string        `yaml:"httpUrl"`
	ApiUrl        string        `yaml:"apiUrl"`
	SkipTls       bool          `yaml:"disable_tls_validation"`
	TechnicalUser TechnicalUser `yaml:"technicalUser"`
}

GitHubInstanceConfig is an object containing config and credentials for a specific github instance. It is defined as in cc-config.

func GetGitHubSecrets

func GetGitHubSecrets() []GitHubInstanceConfig

GetGitHubSecrets returns all github secrets

type GitHubSecrets

type GitHubSecrets struct {
	Secrets []GitHubInstanceConfig `yaml:"secrets"`
}

GitHub holds all git secrets as defined in the environment variable.

type Phase

type Phase string
const (
	// PhaseRunning is the name of the running phase.
	PhaseRunning Phase = "Running"

	// PHASE_EXIT is the name of the running phase.
	PhaseExit Phase = "Exit"
)

type TechnicalUser

type TechnicalUser struct {
	Username  string `yaml:"username"`
	Password  string `yaml:"password"`
	AuthToken string `yaml:"authToken"`
}

TechnicalUser holds the actual git credentials.

type TestLabel

type TestLabel string
const (
	// TestLabelShoot are tests that are meant to test a shoot
	TestLabelShoot TestLabel = "shoot"

	// TestLabelGardener are tests that are meant to test gardener and do not rely on a shoot.
	TestLabelGardener TestLabel = "gardener"

	// TestLabelDefault are tests that are graduated to GA but are not a release blocker
	TestLabelDefault TestLabel = "default"

	// TestLabelRelease are tests that are graduated GA and release blocker
	TestLabelRelease TestLabel = "release"

	// TestLabelBeta are tests that are in beta which means that they are currently unstable
	// but will be promoted to GA someday
	TestLabelBeta TestLabel = "beta"
)

type TmConfiguration

type TmConfiguration struct {
	*config.Configuration
	GitHubSecrets []GitHubInstanceConfig
}

TmConfiguration is an object containing the actual configuration of the Testmachinery

func GetConfig

func GetConfig() *TmConfiguration

GetConfig returns the current testmachinery configuration.

func (*TmConfiguration) Copy

func (c *TmConfiguration) Copy() *TmConfiguration

New creates a deep copy of the configuration

func (*TmConfiguration) String

func (c *TmConfiguration) String() string

String returns the sanitized TestMachinery configuration as formatted string

Jump to

Keyboard shortcuts

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