Documentation ¶
Index ¶
- Constants
- Variables
- type AnalysisRunExpectation
- type AnalysisRunListExpectation
- type Common
- func (c *Common) ApplyManifests(text string)
- func (c *Common) CheckError(err error)
- func (c *Common) GetALBIngress() *networkingv1.Ingress
- func (c *Common) GetALBIngresses() []*networkingv1.Ingress
- func (c *Common) GetApisixRoute() *unstructured.Unstructured
- func (c *Common) GetApisixSetHeaderRoute() *unstructured.Unstructured
- func (c *Common) GetAppMeshVirtualRouter() *unstructured.Unstructured
- func (c *Common) GetBackgroundAnalysisRun() *rov1.AnalysisRun
- func (c *Common) GetControllerConfig() *corev1.ConfigMap
- func (c *Common) GetDestinationRule() *istio.DestinationRule
- func (c *Common) GetExperimentAnalysisRun(exp *rov1.Experiment) *rov1.AnalysisRun
- func (c *Common) GetExperimentByName(name string) *rov1.Experiment
- func (c *Common) GetExperimentByRevision(revision string) *rov1.Experiment
- func (c *Common) GetInlineAnalysisRun() *rov1.AnalysisRun
- func (c *Common) GetJobFromAnalysisRun(ar *rov1.AnalysisRun) *batchv1.Job
- func (c *Common) GetNginxIngressCanary() *networkingv1.Ingress
- func (c *Common) GetNginxIngressStable() *networkingv1.Ingress
- func (c *Common) GetPodsByRevision(revision string) *corev1.PodList
- func (c *Common) GetPostPromotionAnalysisRun() *rov1.AnalysisRun
- func (c *Common) GetPrePromotionAnalysisRun() *rov1.AnalysisRun
- func (c *Common) GetReplicaSetByRevision(revision string) *appsv1.ReplicaSet
- func (c *Common) GetReplicaSetFromExperiment(exp *rov1.Experiment, templateName string) *appsv1.ReplicaSet
- func (c *Common) GetRollout() *rov1.Rollout
- func (c *Common) GetRolloutAnalysisRuns() rov1.AnalysisRunList
- func (c *Common) GetRolloutEventReasons() []string
- func (c *Common) GetRolloutExperiments() rov1.ExperimentList
- func (c *Common) GetServices() (*corev1.Service, *corev1.Service)
- func (c *Common) GetTrafficSplit() *smiv1alpha1.TrafficSplit
- func (c *Common) GetVirtualService() *istio.VirtualService
- func (c *Common) MarkPodsReady(revision string, quantity int) int
- func (c *Common) PrintExperiment(name string)
- func (c *Common) PrintExperimentEvents(ex *v1alpha1.Experiment)
- func (c *Common) PrintExperimentYAML(ex *rov1.Experiment)
- func (c *Common) PrintObjectEvents(opts metav1.ListOptions)
- func (c *Common) PrintRollout(name string)
- func (c *Common) PrintRolloutEvents(ro *v1alpha1.Rollout)
- func (c *Common) PrintRolloutYAML(ro *rov1.Rollout)
- func (c *Common) Rollout() *rov1.Rollout
- func (c *Common) SetLabels(obj *unstructured.Unstructured)
- func (c *Common) StartEventWatch(ctx context.Context)
- type DeploymentExpectation
- type E2ESuite
- type ExperimentExpectation
- type ExperimentListExpectation
- type ExperimentServiceListExpectation
- type ExperimentTemplateReplicaSetExpectation
- type Given
- func (g *Given) HealthyRollout(text string) *Given
- func (g *Given) RolloutObjects(text string) *Given
- func (g *Given) RolloutTemplate(text string, values map[string]string) *Given
- func (g *Given) SetSteps(text string) *Given
- func (g *Given) StartEventWatch(ctx context.Context) *Given
- func (g *Given) When() *When
- type PodExpectation
- type ReplicaSetExpectation
- type ReplicasetExpectation
- type RolloutExpectation
- type Then
- func (t *Then) Assert(assertFunc func(t *Then)) *Then
- func (t *Then) ExpectActiveRevision(revision string) *Then
- func (t *Then) ExpectAnalysisRunCount(expectedCount int) *Then
- func (t *Then) ExpectAnalysisRuns(expectation string, expectFunc AnalysisRunListExpectation) *Then
- func (t *Then) ExpectBackgroundAnalysisRun(expectation string, expectFunc AnalysisRunExpectation) *Then
- func (t *Then) ExpectBackgroundAnalysisRunPhase(phase string) *Then
- func (t *Then) ExpectCanaryStablePodCount(canaryCount, stableCount int) *Then
- func (t *Then) ExpectDeploymentReplicasCount(expectation string, deploymentName string, expectedReplicaCount int) *Then
- func (t *Then) ExpectExperimentByRevision(expectation string, revision string, expectFunc ExperimentExpectation) *Then
- func (t *Then) ExpectExperimentByRevisionPhase(revision string, phase string) *Then
- func (t *Then) ExpectExperimentCount(expectedCount int) *Then
- func (t *Then) ExpectExperimentDryRunSummary(expectedCount, expectedErrorCount, expectedFailureCount int32, ...) *Then
- func (t *Then) ExpectExperimentMeasurementsLength(metricResultsIndex, expectedMeasurementsLength int, experiment string) *Then
- func (t *Then) ExpectExperimentServiceCount(experimentName string, expectedCount int) *Then
- func (t *Then) ExpectExperimentServices(expectation string, experiment string, ...) *Then
- func (t *Then) ExpectExperimentTemplateReplicaSet(expectation string, experiment string, template string, ...) *Then
- func (t *Then) ExpectExperimentTemplateReplicaSetNumReplicas(experiment string, template string, expectedReplicas int) *Then
- func (t *Then) ExpectExperiments(expectation string, expectFunc ExperimentListExpectation) *Then
- func (t *Then) ExpectInlineAnalysisRun(expectation string, expectFunc AnalysisRunExpectation) *Then
- func (t *Then) ExpectInlineAnalysisRunPhase(phase string) *Then
- func (t *Then) ExpectPods(expectation string, expectFunc PodExpectation) *Then
- func (t *Then) ExpectPreviewRevision(revision string) *Then
- func (t *Then) ExpectRS(expectation string, name string, expectFunc ReplicasetExpectation) *Then
- func (t *Then) ExpectReplicaCounts(desired, current, updated, ready, available any) *Then
- func (t *Then) ExpectReplicaSets(expectation string, expectFunc ReplicaSetExpectation) *Then
- func (t *Then) ExpectRevisionPodCount(revision string, expectedCount int) *Then
- func (t *Then) ExpectRevisionPods(expectation string, revision string, expectFunc PodExpectation) *Then
- func (t *Then) ExpectRevisionScaleDown(revision string, expectScaleDown bool) *Then
- func (t *Then) ExpectRollout(expectation string, expectFunc RolloutExpectation) *Then
- func (t *Then) ExpectRolloutEvents(reasons []string) *Then
- func (t *Then) ExpectRolloutEventsContains(reasons []string) *Then
- func (t *Then) ExpectRolloutStatus(expectedStatus string) *Then
- func (t *Then) ExpectServiceSelector(service string, selector map[string]string, ensurePodTemplateHash bool) *Then
- func (t *Then) ExpectStableRevision(revision string) *Then
- func (t *Then) Given() *Given
- func (t *Then) When() *When
- type When
- func (w *When) AbortRollout() *When
- func (w *When) ApplyManifests(yaml ...string) *When
- func (w *When) DeleteObject(kind, name string) *When
- func (w *When) DeleteRollout() *When
- func (w *When) Given() *Given
- func (w *When) MarkPodsReady(revision string, count int, timeouts ...time.Duration) *When
- func (w *When) PatchSpec(patch string) *When
- func (w *When) PromoteRollout() *When
- func (w *When) PromoteRolloutFull() *When
- func (w *When) RestartRollout() *When
- func (w *When) RetryRollout() *When
- func (w *When) ScaleRollout(scale int) *When
- func (w *When) Sleep(d time.Duration) *When
- func (w *When) StartLoad() *When
- func (w *When) StopLoad() *When
- func (w *When) Then() *Then
- func (w *When) UndoRollout(toRevision int64) *When
- func (w *When) UpdateResource(gvr schema.GroupVersionResource, name string, ...) *When
- func (w *When) UpdateSpec(texts ...string) *When
- func (w *When) Wait(duration time.Duration) *When
- func (w *When) WaitForActiveRevision(revision string, timeout ...time.Duration) *When
- func (w *When) WaitForAnalysisRunCondition(name string, test func(ar *rov1.AnalysisRun) bool, condition string, ...) *When
- func (w *When) WaitForBackgroundAnalysisRunPhase(phase string) *When
- func (w *When) WaitForExperimentCondition(name string, test func(ex *rov1.Experiment) bool, condition string, ...) *When
- func (w *When) WaitForExperimentPhase(name string, phase string) *When
- func (w *When) WaitForInlineAnalysisRunPhase(phase string) *When
- func (w *When) WaitForPostPromotionAnalysisRunPhase(phase string) *When
- func (w *When) WaitForPrePromotionAnalysisRunPhase(phase string) *When
- func (w *When) WaitForRevisionPodCount(revision string, count int, timeouts ...time.Duration) *When
- func (w *When) WaitForRolloutAvailableReplicas(count int32, timeout ...time.Duration) *When
- func (w *When) WaitForRolloutCanaryStepIndex(index int32, timeout ...time.Duration) *When
- func (w *When) WaitForRolloutCondition(test func(ro *rov1.Rollout) bool, condition string, timeouts ...time.Duration) *When
- func (w *When) WaitForRolloutReplicas(count int32, timeout ...time.Duration) *When
- func (w *When) WaitForRolloutStatus(status string, timeout ...time.Duration) *When
- func (w *When) WaitForRolloutStepPluginRunning(timeout ...time.Duration) *When
- func (w *When) WatchRolloutStatus(expectedStatus string, timeouts ...time.Duration) *When
Constants ¶
const ( // E2E_INSTANCE_ID is the instance id label attached to objects created by the e2e tests EnvVarE2EInstanceID = "E2E_INSTANCE_ID" // E2E_WAIT_TIMEOUT is a timeout in seconds when waiting for a test condition (default: 90) EnvVarE2EWaitTimeout = "E2E_WAIT_TIMEOUT" // E2E_POD_DELAY slows down pod startup and shutdown by the value in seconds (default: 0) // Used humans slow down rollout activity during a test EnvVarE2EPodDelay = "E2E_POD_DELAY" // EnvVarE2EImagePrefix is a prefix that will be prefixed to images used by the e2e tests EnvVarE2EImagePrefix = "E2E_IMAGE_PREFIX" // E2E_DEBUG makes e2e testing easier to debug by not tearing down the suite EnvVarE2EDebug = "E2E_DEBUG" // E2E_ALB_INGESS_ANNOTATIONS is a map of annotations to apply to ingress for AWS Load Balancer Controller EnvVarE2EALBIngressAnnotations = "E2E_ALB_INGESS_ANNOTATIONS" // E2E_KLOG_LEVEL controls the kuberntes klog level for e2e tests EnvVarE2EKLogLevel = "E2E_KLOG_LEVEL" )
Variables ¶
var ( E2EWaitTimeout time.Duration = time.Second * 90 E2EPodDelay = 0 E2EALBIngressAnnotations map[string]string // All e2e tests will be labeled with this instance-id (unless E2E_INSTANCE_ID="") E2ELabelValueInstanceID = "argo-rollouts-e2e" // All e2e tests will be labeled with their test name E2ELabelKeyTestName = "e2e-test-name" )
Functions ¶
This section is empty.
Types ¶
type AnalysisRunExpectation ¶
type AnalysisRunExpectation func(*rov1.AnalysisRun) bool
type AnalysisRunListExpectation ¶
type AnalysisRunListExpectation func(*rov1.AnalysisRunList) bool
type Common ¶
func (*Common) ApplyManifests ¶
ApplyManifests kubectl applys the given YAML string or file path: 1. A file name if it starts with "@" 2. Raw YAML.
func (*Common) CheckError ¶
func (*Common) GetALBIngress ¶
func (c *Common) GetALBIngress() *networkingv1.Ingress
func (*Common) GetALBIngresses ¶
func (c *Common) GetALBIngresses() []*networkingv1.Ingress
func (*Common) GetApisixRoute ¶
func (c *Common) GetApisixRoute() *unstructured.Unstructured
func (*Common) GetApisixSetHeaderRoute ¶
func (c *Common) GetApisixSetHeaderRoute() *unstructured.Unstructured
func (*Common) GetAppMeshVirtualRouter ¶
func (c *Common) GetAppMeshVirtualRouter() *unstructured.Unstructured
func (*Common) GetBackgroundAnalysisRun ¶
func (c *Common) GetBackgroundAnalysisRun() *rov1.AnalysisRun
func (*Common) GetControllerConfig ¶
func (*Common) GetDestinationRule ¶
func (c *Common) GetDestinationRule() *istio.DestinationRule
func (*Common) GetExperimentAnalysisRun ¶
func (c *Common) GetExperimentAnalysisRun(exp *rov1.Experiment) *rov1.AnalysisRun
GetExperimentAnalysisRun returns the AnalysisRun associated with the experiment. Errors if there is more than one.
func (*Common) GetExperimentByName ¶
func (c *Common) GetExperimentByName(name string) *rov1.Experiment
func (*Common) GetExperimentByRevision ¶
func (c *Common) GetExperimentByRevision(revision string) *rov1.Experiment
func (*Common) GetInlineAnalysisRun ¶
func (c *Common) GetInlineAnalysisRun() *rov1.AnalysisRun
GetInlineAnalysisRun returns the latest Step analysis run. This should generally be coupled with a count check, to ensure we are not checking the previous one. This may fail to accurately return the latest if the creationTimestamps are the same
func (*Common) GetJobFromAnalysisRun ¶
func (c *Common) GetJobFromAnalysisRun(ar *rov1.AnalysisRun) *batchv1.Job
GetJobFromAnalysisRun returns the Job associated with the AnalysisRun. Errors if there is more than one.
func (*Common) GetNginxIngressCanary ¶
func (c *Common) GetNginxIngressCanary() *networkingv1.Ingress
func (*Common) GetNginxIngressStable ¶
func (c *Common) GetNginxIngressStable() *networkingv1.Ingress
func (*Common) GetPodsByRevision ¶
func (*Common) GetPostPromotionAnalysisRun ¶
func (c *Common) GetPostPromotionAnalysisRun() *rov1.AnalysisRun
func (*Common) GetPrePromotionAnalysisRun ¶
func (c *Common) GetPrePromotionAnalysisRun() *rov1.AnalysisRun
func (*Common) GetReplicaSetByRevision ¶
func (c *Common) GetReplicaSetByRevision(revision string) *appsv1.ReplicaSet
func (*Common) GetReplicaSetFromExperiment ¶
func (c *Common) GetReplicaSetFromExperiment(exp *rov1.Experiment, templateName string) *appsv1.ReplicaSet
func (*Common) GetRollout ¶
GetRollout returns the live rollout object in the cluster
func (*Common) GetRolloutAnalysisRuns ¶
func (c *Common) GetRolloutAnalysisRuns() rov1.AnalysisRunList
func (*Common) GetRolloutEventReasons ¶
func (*Common) GetRolloutExperiments ¶
func (c *Common) GetRolloutExperiments() rov1.ExperimentList
func (*Common) GetServices ¶
GetServices() returns the desired (aka preview/canary) and stable (aka active) services
func (*Common) GetTrafficSplit ¶
func (c *Common) GetTrafficSplit() *smiv1alpha1.TrafficSplit
func (*Common) GetVirtualService ¶
func (c *Common) GetVirtualService() *istio.VirtualService
func (*Common) MarkPodsReady ¶
MarkPodsReady is a helper to mark the readiness gates of pods of a particular revision as ready.
func (*Common) PrintExperiment ¶
func (*Common) PrintExperimentEvents ¶
func (c *Common) PrintExperimentEvents(ex *v1alpha1.Experiment)
PrintExperimentEvents prints all Kubernetes events associated with the given experiment.
func (*Common) PrintExperimentYAML ¶
func (c *Common) PrintExperimentYAML(ex *rov1.Experiment)
func (*Common) PrintObjectEvents ¶
func (c *Common) PrintObjectEvents(opts metav1.ListOptions)
PrintObjectEvents prints all Kubernetes events associated with the given object. Note that events may be deduplicated, or printed out-of-order from when they were emitted, so this function should only be used to assist with debugging and not correctness.
func (*Common) PrintRollout ¶
func (*Common) PrintRolloutEvents ¶
PrintRolloutEvents prints all Kubernetes events associated with the given rollout.
func (*Common) PrintRolloutYAML ¶
func (*Common) SetLabels ¶
func (c *Common) SetLabels(obj *unstructured.Unstructured)
func (*Common) StartEventWatch ¶
We use a watch to collect events (as opposed to listing them after-the-fact), because: 1. the kubernetes event recorder can dedupe multiple events into one Event object 2. listing events may return events out-of-order from when they were produced
type DeploymentExpectation ¶
type DeploymentExpectation func(*appsv1.Deployment) bool
type E2ESuite ¶
type E2ESuite struct { suite.Suite Common IstioEnabled bool SMIEnabled bool AppMeshEnabled bool ApisixEnabled bool }
func (*E2ESuite) BeforeTest ¶
func (*E2ESuite) SetupSuite ¶
func (s *E2ESuite) SetupSuite()
func (*E2ESuite) TearDownSuite ¶
func (s *E2ESuite) TearDownSuite()
type ExperimentExpectation ¶
type ExperimentExpectation func(*rov1.Experiment) bool
type ExperimentListExpectation ¶
type ExperimentListExpectation func(*rov1.ExperimentList) bool
type ExperimentTemplateReplicaSetExpectation ¶
type ExperimentTemplateReplicaSetExpectation func(set *appsv1.ReplicaSet) bool
type Given ¶
type Given struct {
*Common
}
func (*Given) HealthyRollout ¶
HealthyRollout is a convenience around creating a rollout and waiting for it to become healthy
func (*Given) RolloutObjects ¶
RolloutObjects sets up the rollout objects for the test environment given a YAML string or file path: 1. A file name if it starts with "@" 2. Raw YAML.
func (*Given) RolloutTemplate ¶
type PodExpectation ¶
type ReplicaSetExpectation ¶
type ReplicaSetExpectation func(*appsv1.ReplicaSetList) bool
type ReplicasetExpectation ¶
type ReplicasetExpectation func(*appsv1.ReplicaSet) bool
type RolloutExpectation ¶
type Then ¶
type Then struct {
*Common
}
func (*Then) ExpectActiveRevision ¶
ExpectActiveRevision verifies the active service selector is pointing to the specified revision
func (*Then) ExpectAnalysisRunCount ¶
func (*Then) ExpectAnalysisRuns ¶
func (t *Then) ExpectAnalysisRuns(expectation string, expectFunc AnalysisRunListExpectation) *Then
func (*Then) ExpectBackgroundAnalysisRun ¶
func (t *Then) ExpectBackgroundAnalysisRun(expectation string, expectFunc AnalysisRunExpectation) *Then
func (*Then) ExpectBackgroundAnalysisRunPhase ¶
func (*Then) ExpectCanaryStablePodCount ¶
func (*Then) ExpectDeploymentReplicasCount ¶
func (*Then) ExpectExperimentByRevision ¶
func (t *Then) ExpectExperimentByRevision(expectation string, revision string, expectFunc ExperimentExpectation) *Then
func (*Then) ExpectExperimentByRevisionPhase ¶
func (*Then) ExpectExperimentCount ¶
func (*Then) ExpectExperimentDryRunSummary ¶
func (*Then) ExpectExperimentMeasurementsLength ¶
func (*Then) ExpectExperimentServiceCount ¶
func (*Then) ExpectExperimentServices ¶
func (t *Then) ExpectExperimentServices(expectation string, experiment string, expectFunc ExperimentServiceListExpectation) *Then
func (*Then) ExpectExperimentTemplateReplicaSet ¶
func (*Then) ExpectExperimentTemplateReplicaSetNumReplicas ¶
func (*Then) ExpectExperiments ¶
func (t *Then) ExpectExperiments(expectation string, expectFunc ExperimentListExpectation) *Then
func (*Then) ExpectInlineAnalysisRun ¶
func (t *Then) ExpectInlineAnalysisRun(expectation string, expectFunc AnalysisRunExpectation) *Then
func (*Then) ExpectInlineAnalysisRunPhase ¶
func (*Then) ExpectPods ¶
func (t *Then) ExpectPods(expectation string, expectFunc PodExpectation) *Then
func (*Then) ExpectPreviewRevision ¶
ExpectPreviewRevision verifies the preview service selector is pointing to the specified revision
func (*Then) ExpectRS ¶
func (t *Then) ExpectRS(expectation string, name string, expectFunc ReplicasetExpectation) *Then
func (*Then) ExpectReplicaCounts ¶
func (*Then) ExpectReplicaSets ¶
func (t *Then) ExpectReplicaSets(expectation string, expectFunc ReplicaSetExpectation) *Then
func (*Then) ExpectRevisionPodCount ¶
func (*Then) ExpectRevisionPods ¶
func (t *Then) ExpectRevisionPods(expectation string, revision string, expectFunc PodExpectation) *Then
func (*Then) ExpectRevisionScaleDown ¶
func (*Then) ExpectRollout ¶
func (t *Then) ExpectRollout(expectation string, expectFunc RolloutExpectation) *Then
func (*Then) ExpectRolloutEvents ¶
func (*Then) ExpectRolloutEventsContains ¶
func (*Then) ExpectRolloutStatus ¶
func (*Then) ExpectServiceSelector ¶
func (*Then) ExpectStableRevision ¶
ExpectStableRevision verifies the ReplicaSet with the specified revision is marked stable
type When ¶
type When struct {
*Common
}
func (*When) AbortRollout ¶
func (*When) ApplyManifests ¶
func (*When) DeleteObject ¶
func (*When) DeleteRollout ¶
func (*When) MarkPodsReady ¶
func (*When) PromoteRollout ¶
func (*When) PromoteRolloutFull ¶
func (*When) RestartRollout ¶
func (*When) RetryRollout ¶
func (*When) ScaleRollout ¶
func (*When) UndoRollout ¶
func (*When) UpdateResource ¶
func (w *When) UpdateResource(gvr schema.GroupVersionResource, name string, update func(res *unstructured.Unstructured) error) *When
UpdateResource modifies the specified resource