Documentation ¶
Index ¶
- Constants
- func AssertThatContainerHasEnv(t *testing.T, cont v1.Container, expName, expValue string)
- func AssertThatContainerHasEnvFromSecret(t *testing.T, cont v1.Container, expName, expSecretName, expSecretKey string)
- func AssertThatExecGolangBuildpack(t *testing.T, job config.JobBase, img string, args ...string)
- func AssertThatHasExtraRef(t *testing.T, in config.UtilityConfig, extraRefs []prowapi.Refs)
- func AssertThatHasExtraRefTestInfra(t *testing.T, in config.UtilityConfig, expectedBaseRef string)
- func AssertThatHasExtraRefTestInfraWithSHA(t *testing.T, in config.UtilityConfig, expectedBaseRef, expectedBaseSHA string)
- func AssertThatHasExtraRepoRef(t *testing.T, in config.UtilityConfig, repositories []string)
- func AssertThatHasExtraRepoRefCustom(t *testing.T, in config.UtilityConfig, repositories []string, ...)
- func AssertThatHasPresets(t *testing.T, in config.JobBase, expected ...preset.Preset)
- func AssertThatJobDoesNotRunIfChanged(t *testing.T, p jobRunner, changedFile string)
- func AssertThatJobRunIfChanged(t *testing.T, p jobRunner, changedFile string)
- func AssertThatSpecifiesResourceRequests(t *testing.T, job config.JobBase)
- func FindPeriodicJobByName(jobs []config.Periodic, name string) *config.Periodic
- func FindPostsubmitJobByName(jobs []config.Postsubmit, name string) *config.Postsubmit
- func FindPostsubmitJobByNameAndBranch(jobs []config.Postsubmit, name, branch string) *config.Postsubmit
- func FindPresubmitJobByName(jobs []config.Presubmit, name string) *config.Presubmit
- func FindPresubmitJobByNameAndBranch(jobs []config.Presubmit, name, branch string) *config.Presubmit
- func GetReleaseJobName(moduleName string, release *releases.SupportedRelease) string
- func GetReleasePostSubmitJobName(moduleName string, release *releases.SupportedRelease) string
- func IfPostsubmitShouldRunAgainstChanges(job config.Postsubmit, changedFiles ...string) bool
- func IfPresubmitShouldRunAgainstChanges(job config.Presubmit, def bool, changedFiles ...string) bool
- func NewComponentSuite(config *jobsuite.Config) jobsuite.Suite
- func NewGenericComponentSuite(config *jobsuite.Config) jobsuite.Suite
- func ReadJobConfig(fileName string) (config.JobConfig, error)
- type ComponentSuite
- type GenericComponentSuite
Constants ¶
const ( // ImageGolangBuildpackLatest means Golang buildpack image ImageGolangBuildpackLatest = "eu.gcr.io/kyma-project/prow/test-infra/buildpack-golang:v20181119-afd3fbd" // ImageGolangBuildpack1_11 means Golang buildpack image with Go 1.11.* ImageGolangBuildpack1_11 = "eu.gcr.io/kyma-project/test-infra/buildpack-golang:go1.11" // ImageGolangBuildpack1_12 means Golang buildpack image with Go 1.12.* ImageGolangBuildpack1_12 = "eu.gcr.io/kyma-project/test-infra/buildpack-golang:go1.12" // ImageGolangBuildpack1_13 means Golang buildpack image with Go 1.13.* ImageGolangBuildpack1_13 = "eu.gcr.io/kyma-project/test-infra/buildpack-golang:go1.13" // ImageGolangBuildpack1_14 means Golang buildpack image with Go 1.14.* ImageGolangBuildpack1_14 = "eu.gcr.io/kyma-project/test-infra/buildpack-golang:go1.14" // ImageGolangKubebuilder2BuildpackLatest means Golang buildpack with Kubebuilder2 image ImageGolangKubebuilder2BuildpackLatest = "eu.gcr.io/kyma-project/test-infra/buildpack-golang-kubebuilder2:v20210407-70afe459" // ImageGolangKubebuilder2_20210216 contains the v20210216-1.14.0-rc1-535-gb45951c9 image ImageGolangKubebuilder2_20210216 = "eu.gcr.io/kyma-project/test-infra/buildpack-golang-kubebuilder2:v20210216-1.14.0-rc1-535-gb45951c9" // ImageNode10Buildpack means Node.js buildpack image (node v10) ImageNode10Buildpack = "eu.gcr.io/kyma-project/prow/test-infra/buildpack-node:v20181130-b28250b" // ImageNodeBuildpackLatest means Node.js buildpack image (node v12) ImageNodeBuildpackLatest = "eu.gcr.io/kyma-project/test-infra/buildpack-node:PR-2951" // ImageNodeChromiumBuildpackLatest means Node.js + Chromium buildpack image ImageNodeChromiumBuildpackLatest = "eu.gcr.io/kyma-project/prow/test-infra/buildpack-node-chromium:v20181207-d46c013" // ImageBootstrapLatest means Bootstrap image ImageBootstrapLatest = "eu.gcr.io/kyma-project/prow/test-infra/bootstrap:v20181121-f3ea5ce" // ImageBootstrapTestInfraLatest means it's used in test-infra prowjob defs. ImageBootstrapTestInfraLatest = "eu.gcr.io/kyma-project/test-infra/bootstrap:PR-2951" // ImageBootstrapTestInfraCurrent means it's used in test-infra prowjob defs. ImageBootstrapTestInfraCurrent = "eu.gcr.io/kyma-project/test-infra/bootstrap:current" // ImageBootstrap20181204 represents boostrap image published on 2018.12.04 ImageBootstrap20181204 = "eu.gcr.io/kyma-project/prow/test-infra/bootstrap:v20181204-a6e79be" // ImageBootstrap20190604 represents boostrap image published on 2019.06.04 ImageBootstrap20190604 = "eu.gcr.io/kyma-project/test-infra/bootstrap:v20190604-d08e7fe" // ImageBootstrap001 represents version 0.0.1 of bootstrap image ImageBootstrap001 = "eu.gcr.io/kyma-project/prow/bootstrap:0.0.1" // ImageKymaIntegrationK14 represents kyma integration image with kubectl 1.14 ImageKymaIntegrationK14 = "eu.gcr.io/kyma-project/test-infra/kyma-integration:v20200817-1.14.0-rc1-75-g625c1054-k8s1.14" // ImageKymaIntegrationK15 represents kyma integration image with kubectl 1.15 ImageKymaIntegrationK15 = "eu.gcr.io/kyma-project/test-infra/kyma-integration:v20200817-1.14.0-rc1-75-g625c1054-k8s1.15" // ImageKymaIntegrationLatest represents kyma integration image with kubectl 1.16 ImageKymaIntegrationLatest = "eu.gcr.io/kyma-project/test-infra/kyma-integration:v20210402-70b4b74f-k8s1.16" // ImageGolangToolboxLatest represents the latest version of the golang buildpack toolbox ImageGolangToolboxLatest = "eu.gcr.io/kyma-project/test-infra/buildpack-golang-toolbox:v20210323-bfa93550" // ImageProwToolsLatest represents the latest version of the prow-tools image ImageProwToolsLatest = "eu.gcr.io/kyma-project/test-infra/prow-tools:v20210401-294e46e5" // ImageProwToolsCurrent represents the latest version of the prow-tools image ImageProwToolsCurrent = "eu.gcr.io/kyma-project/test-infra/prow-tools:current" // KymaProjectDir means kyma project dir KymaProjectDir = "/home/prow/go/src/github.com/kyma-project" // KymaIncubatorDir means kyma incubator dir KymaIncubatorDir = "/home/prow/go/src/github.com/kyma-incubator" // GovernanceScriptDir means governance script directory GovernanceScriptDir = "/home/prow/go/src/github.com/kyma-project/test-infra/prow/scripts/governance.sh" // MetadataGovernanceScriptDir means governance script directory MetadataGovernanceScriptDir = "/home/prow/go/src/github.com/kyma-project/test-infra/prow/scripts/metadata-governance.sh" )
Variables ¶
This section is empty.
Functions ¶
func AssertThatContainerHasEnv ¶
AssertThatContainerHasEnv checks if container has specified given environment variable
func AssertThatContainerHasEnvFromSecret ¶
func AssertThatContainerHasEnvFromSecret(t *testing.T, cont v1.Container, expName, expSecretName, expSecretKey string)
AssertThatContainerHasEnvFromSecret checks if container has specified given environment variable
func AssertThatExecGolangBuildpack ¶
AssertThatExecGolangBuildpack checks if job executes golang buildpack
func AssertThatHasExtraRef ¶
AssertThatHasExtraRef checks if UtilityConfig has ExtraRefs passed in argument defined
func AssertThatHasExtraRefTestInfra ¶
func AssertThatHasExtraRefTestInfra(t *testing.T, in config.UtilityConfig, expectedBaseRef string)
AssertThatHasExtraRefTestInfra checks if job has configured extra ref to test-infra repository
func AssertThatHasExtraRefTestInfraWithSHA ¶
func AssertThatHasExtraRefTestInfraWithSHA(t *testing.T, in config.UtilityConfig, expectedBaseRef, expectedBaseSHA string)
AssertThatHasExtraRefTestInfraWithSHA checks if job has configured extra ref to test-infra repository with appropriate sha
func AssertThatHasExtraRepoRef ¶
func AssertThatHasExtraRepoRef(t *testing.T, in config.UtilityConfig, repositories []string)
AssertThatHasExtraRepoRef checks if UtilityConfig has repositories passed in argument defined
func AssertThatHasExtraRepoRefCustom ¶
func AssertThatHasExtraRepoRefCustom(t *testing.T, in config.UtilityConfig, repositories []string, branches []string)
AssertThatHasExtraRepoRefCustom checks if UtilityConfig has repositories passed in argument defined with custom branches set
func AssertThatHasPresets ¶
AssertThatHasPresets checks if JobBase has expected labels
func AssertThatJobDoesNotRunIfChanged ¶
AssertThatJobDoesNotRunIfChanged checks if job that has specified run_if_changed parameter will not be triggered by changes in specified file. Deprecated: Please use IfPresubmitShouldRunAgainstChanges or IfPostsubmitShouldRunAgainstChanges for determining if job should run against given files.
func AssertThatJobRunIfChanged ¶
AssertThatJobRunIfChanged checks if job that has specified run_if_changed parameter will be triggered by changes in specified file. Deprecated: Please use IfPresubmitShouldRunAgainstChanges or IfPostsubmitShouldRunAgainstChanges for determining if job should run against given files.
func AssertThatSpecifiesResourceRequests ¶
AssertThatSpecifiesResourceRequests checks if resources requests for memory and cpu are specified
func FindPeriodicJobByName ¶
FindPeriodicJobByName finds periodic job by name from provided jobs list
func FindPostsubmitJobByName ¶
func FindPostsubmitJobByName(jobs []config.Postsubmit, name string) *config.Postsubmit
FindPostsubmitJobByName finds postsubmit job by name from provided jobs list
func FindPostsubmitJobByNameAndBranch ¶
func FindPostsubmitJobByNameAndBranch(jobs []config.Postsubmit, name, branch string) *config.Postsubmit
FindPostsubmitJobByNameAndBranch finds postsubmit job by name from provided jobs list
func FindPresubmitJobByName ¶
FindPresubmitJobByName finds presubmit job by name from provided jobs list
func FindPresubmitJobByNameAndBranch ¶
func FindPresubmitJobByNameAndBranch(jobs []config.Presubmit, name, branch string) *config.Presubmit
FindPresubmitJobByNameAndBranch finds presubmit job by name from provided jobs list
func GetReleaseJobName ¶
func GetReleaseJobName(moduleName string, release *releases.SupportedRelease) string
GetReleaseJobName returns name of release job based on branch name by adding release prefix
func GetReleasePostSubmitJobName ¶
func GetReleasePostSubmitJobName(moduleName string, release *releases.SupportedRelease) string
GetReleasePostSubmitJobName returns name of postsubmit job based on branch name
func IfPostsubmitShouldRunAgainstChanges ¶
func IfPostsubmitShouldRunAgainstChanges(job config.Postsubmit, changedFiles ...string) bool
IfPostsubmitShouldRunAgainstChanges determines if the given postsubmit job should run against given list of files by checking them against regular expression if present.
func IfPresubmitShouldRunAgainstChanges ¶
func IfPresubmitShouldRunAgainstChanges(job config.Presubmit, def bool, changedFiles ...string) bool
IfPresubmitShouldRunAgainstChanges determines if the given presubmit job should run against given list of files by checking them against regular expression if present. If the state of the job execution could not be determined the function returns default state def.
func NewComponentSuite ¶
NewComponentSuite returns new ComponentSuite
func NewGenericComponentSuite ¶
NewGenericComponentSuite returns GenericComponentSuite
Types ¶
type ComponentSuite ¶
ComponentSuite is designed to check validity of jobs generated from /templates/templates/component.yaml
func (ComponentSuite) JobConfigPath ¶
func (s ComponentSuite) JobConfigPath() string
JobConfigPath returns path to job config
func (ComponentSuite) Run ¶
func (s ComponentSuite) Run(t *testing.T)
Run runs tests on a ComponentSuite
type GenericComponentSuite ¶
GenericComponentSuite is designed to check validity of jobs generated from /templates/templates/generic-component.yaml
func (GenericComponentSuite) JobConfigPath ¶
func (s GenericComponentSuite) JobConfigPath() string
JobConfigPath returns path to job config
func (GenericComponentSuite) Run ¶
func (s GenericComponentSuite) Run(t *testing.T)
Run runs tests on a ComponentSuite