integration

package
v0.0.0-...-cc70305 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const SnapshotTestsStatusAnnotation = "test.appstudio.openshift.io/status"

SnapshotTestsStatusAnnotation is annotation in snapshot where integration test results are stored

Variables

This section is empty.

Functions

This section is empty.

Types

type IntegrationController

type IntegrationController struct {
	*kubeCl.CustomClient
}

func NewSuiteController

func NewSuiteController(kube *kubeCl.CustomClient) (*IntegrationController, error)

func (*IntegrationController) CreateIntegrationPipelineRun

func (i *IntegrationController) CreateIntegrationPipelineRun(snapshotName, namespace, componentName, integrationTestScenarioName string) (*tektonv1.PipelineRun, error)

CreateIntegrationPipelineRun creates new integrationPipelineRun.

func (*IntegrationController) CreateIntegrationTestScenario

func (i *IntegrationController) CreateIntegrationTestScenario(itsName, applicationName, namespace, gitURL, revision, pathInRepo string) (*integrationv1beta1.IntegrationTestScenario, error)

CreateIntegrationTestScenario creates beta1 version integrationTestScenario.

func (*IntegrationController) CreateIntegrationTestScenarioWithEnvironment

func (i *IntegrationController) CreateIntegrationTestScenarioWithEnvironment(applicationName, namespace, gitURL, revision, pathInRepo string, environment *appservice.Environment) (*integrationv1beta1.IntegrationTestScenario, error)

CreateIntegrationTestScenarioWithEnvironment will create an IntegrationTestScenario with a user-supplied environment embedded in its Spec.Environment

func (*IntegrationController) CreateSnapshotWithComponents

func (i *IntegrationController) CreateSnapshotWithComponents(snapshotName, componentName, applicationName, namespace string, snapshotComponents []appstudioApi.SnapshotComponent) (*appstudioApi.Snapshot, error)

CreateSnapshotWithComponents creates a Snapshot using the given parameters.

func (*IntegrationController) CreateSnapshotWithImage

func (i *IntegrationController) CreateSnapshotWithImage(componentName, applicationName, namespace, containerImage string) (*appstudioApi.Snapshot, error)

CreateSnapshotWithImage creates a snapshot using an image.

func (*IntegrationController) DeleteAllSnapshotsInASpecificNamespace

func (i *IntegrationController) DeleteAllSnapshotsInASpecificNamespace(namespace string, timeout time.Duration) error

DeleteAllSnapshotsInASpecificNamespace removes all snapshots from a specific namespace. Useful when creating a lot of resources and want to remove all of them

func (*IntegrationController) DeleteIntegrationTestScenario

func (i *IntegrationController) DeleteIntegrationTestScenario(testScenario *integrationv1beta1.IntegrationTestScenario, namespace string) error

DeleteIntegrationTestScenario removes given testScenario from specified namespace.

func (*IntegrationController) DeleteSnapshot

func (i *IntegrationController) DeleteSnapshot(hasSnapshot *appstudioApi.Snapshot, namespace string) error

DeleteSnapshot removes given snapshot from specified namespace.

func (*IntegrationController) GetAnnotationIfExists

func (i *IntegrationController) GetAnnotationIfExists(testNamespace, applicationName, componentName, annotationKey string) (string, error)

GetAnnotationIfExists returns the value of a given annotation within a pipelinerun, if it exists.

func (*IntegrationController) GetBuildPipelineRun

func (i *IntegrationController) GetBuildPipelineRun(componentName, applicationName, namespace string, pacBuild bool, sha string) (*tektonv1.PipelineRun, error)

GetComponentPipeline returns the pipeline for a given component labels. In case of failure, this function retries till it gets timed out.

func (*IntegrationController) GetIntegrationPipelineRun

func (i *IntegrationController) GetIntegrationPipelineRun(integrationTestScenarioName string, snapshotName string, namespace string) (*tektonv1.PipelineRun, error)

GetIntegrationPipelineRun returns the integration pipelineRun for a given scenario, snapshot labels.

func (*IntegrationController) GetIntegrationTestScenarios

func (i *IntegrationController) GetIntegrationTestScenarios(applicationName, namespace string) (*[]integrationv1beta1.IntegrationTestScenario, error)

Get return the status from the Application Custom Resource object.

func (*IntegrationController) GetIntegrationTestStatusDetailFromSnapshot

func (i *IntegrationController) GetIntegrationTestStatusDetailFromSnapshot(snapshot *appstudioApi.Snapshot, scenarioName string) (*intgteststat.IntegrationTestStatusDetail, error)

GetIntegrationTestStatusDetailFromSnapshot parses snapshot annotation and returns integration test status detail

func (*IntegrationController) GetSnapshot

func (i *IntegrationController) GetSnapshot(snapshotName, pipelineRunName, componentName, namespace string) (*appstudioApi.Snapshot, error)

GetSnapshot returns the Snapshot in the namespace and nil if it's not found It will search for the Snapshot based on the Snapshot name, associated PipelineRun name or Component name In the case the List operation fails, an error will be returned.

func (*IntegrationController) GetSnapshotByComponent

func (i *IntegrationController) GetSnapshotByComponent(namespace string) (*appstudioApi.Snapshot, error)

GetSnapshotByComponent returns the first snapshot in namespace if exist, else will return nil

func (*IntegrationController) ListAllSnapshots

func (i *IntegrationController) ListAllSnapshots(namespace string) (*appstudioApi.SnapshotList, error)

ListAllSnapshots returns a list of all Snapshots in a given namespace.

func (*IntegrationController) PatchSnapshot

func (i *IntegrationController) PatchSnapshot(oldSnapshot *appstudioApi.Snapshot, newSnapshot *appstudioApi.Snapshot) error

PatchSnapshot patches the given snapshot with the provided patch.

func (*IntegrationController) StoreAllSnapshots

func (i *IntegrationController) StoreAllSnapshots(namespace string) error

StoreAllSnapshots stores all Snapshots in a given namespace.

func (*IntegrationController) StoreSnapshot

func (i *IntegrationController) StoreSnapshot(snapshot *appstudioApi.Snapshot) error

StoreSnapshot stores a given Snapshot as an artifact.

func (*IntegrationController) WaitForAllIntegrationPipelinesToBeFinished

func (i *IntegrationController) WaitForAllIntegrationPipelinesToBeFinished(testNamespace, applicationName string, snapshot *appstudioApi.Snapshot) error

WaitForAllIntegrationPipelinesToBeFinished wait for all integration pipelines to finish.

func (*IntegrationController) WaitForBuildPipelineRunToGetAnnotated

func (i *IntegrationController) WaitForBuildPipelineRunToGetAnnotated(testNamespace, applicationName, componentName, annotationKey string) error

WaitForBuildPipelineRunToGetAnnotated waits for given build pipeline to get annotated with a specific annotation. In case of failure, this function retries till it gets timed out.

func (*IntegrationController) WaitForFinalizerToGetRemovedFromAllIntegrationPipelineRuns

func (i *IntegrationController) WaitForFinalizerToGetRemovedFromAllIntegrationPipelineRuns(testNamespace, applicationName string, snapshot *appstudioApi.Snapshot) error

WaitForFinalizerToGetRemovedFromAllIntegrationPipelineRuns waits for the given finalizer to get removed from all integration pipelinesruns that are related to the given application and namespace.

func (*IntegrationController) WaitForFinalizerToGetRemovedFromIntegrationPipeline

func (i *IntegrationController) WaitForFinalizerToGetRemovedFromIntegrationPipeline(testScenario *integrationv1beta1.IntegrationTestScenario, snapshot *appstudioApi.Snapshot, appNamespace string) error

WaitForFinalizerToGetRemovedFromIntegrationPipeline waits for the given finalizer to get removed from the given integration pipelinerun

func (*IntegrationController) WaitForIntegrationPipelineToBeFinished

func (i *IntegrationController) WaitForIntegrationPipelineToBeFinished(testScenario *integrationv1beta1.IntegrationTestScenario, snapshot *appstudioApi.Snapshot, appNamespace string) error

WaitForIntegrationPipelineToBeFinished wait for given integration pipeline to finish. In case of failure, this function retries till it gets timed out.

func (*IntegrationController) WaitForIntegrationPipelineToGetStarted

func (i *IntegrationController) WaitForIntegrationPipelineToGetStarted(testScenarioName, snapshotName, appNamespace string) (*tektonv1.PipelineRun, error)

WaitForIntegrationPipelineToGetStarted wait for given integration pipeline to get started. In case of failure, this function retries till it gets timed out.

func (*IntegrationController) WaitForSnapshotToGetCreated

func (i *IntegrationController) WaitForSnapshotToGetCreated(snapshotName, pipelinerunName, componentName, testNamespace string) (*appstudioApi.Snapshot, error)

WaitForSnapshotToGetCreated wait for the Snapshot to get created successfully.

Jump to

Keyboard shortcuts

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