Documentation
¶
Index ¶
- type Actions
- func (a *Actions) AddAnnotatedTag(name string, message string) *Actions
- func (a *Actions) AddFile(fileName, fileContents string) *Actions
- func (a *Actions) AddSignedFile(fileName, fileContents string) *Actions
- func (a *Actions) AddSignedTag(name string) *Actions
- func (a *Actions) AddTag(name string) *Actions
- func (a *Actions) AddTagWithForce(name string) *Actions
- func (a *Actions) And(block func()) *Actions
- func (a *Actions) AppSet(flags ...string) *Actions
- func (a *Actions) AppUnSet(flags ...string) *Actions
- func (a *Actions) ConfirmDeletion() *Actions
- func (a *Actions) CreateApp(args ...string) *Actions
- func (a *Actions) CreateFromFile(handler func(app *v1alpha1.Application), flags ...string) *Actions
- func (a *Actions) CreateFromPartialFile(data string, flags ...string) *Actions
- func (a *Actions) CreateMultiSourceApp(flags ...string) *Actions
- func (a *Actions) CreateMultiSourceAppFromFile(handler func(app *v1alpha1.Application), flags ...string) *Actions
- func (a *Actions) CreateWithNoNameSpace(args ...string) *Actions
- func (a *Actions) Declarative(filename string) *Actions
- func (a *Actions) DeclarativeWithCustomRepo(filename string, repoURL string) *Actions
- func (a *Actions) Delete(cascade bool) *Actions
- func (a *Actions) DeleteBySelector(selector string) *Actions
- func (a *Actions) DeleteBySelectorWithWait(selector string) *Actions
- func (a *Actions) DeleteFile(file string) *Actions
- func (a *Actions) DoNotIgnoreErrors() *Actions
- func (a *Actions) Get() *Actions
- func (a *Actions) IgnoreErrors() *Actions
- func (a *Actions) PatchApp(patch string) *Actions
- func (a *Actions) PatchAppHttp(patch string) *Actions
- func (a *Actions) PatchFile(file string, jsonPatch string) *Actions
- func (a *Actions) Refresh(refreshType v1alpha1.RefreshType) *Actions
- func (a *Actions) RemoveSubmodule() *Actions
- func (a *Actions) SetInstallationID(installationID string) *Actions
- func (a *Actions) SetParamInSettingConfigMap(key, value string) *Actions
- func (a *Actions) SetTrackingLabel(trackingLabel string) *Actions
- func (a *Actions) SetTrackingMethod(trackingMethod string) *Actions
- func (a *Actions) Sync(args ...string) *Actions
- func (a *Actions) TerminateOp() *Actions
- func (a *Actions) Then() *Consequences
- func (a *Actions) Wait(args ...string) *Actions
- func (a *Actions) WithImpersonationDisabled() *Actions
- func (a *Actions) WithImpersonationEnabled(serviceAccountName string, policyRules []rbacv1.PolicyRule) *Actions
- func (a *Actions) WithImpersonationEnforcementDisabled() *Actions
- func (a *Actions) WriteFile(fileName, fileContents string) *Actions
- type Consequences
- func (c *Consequences) And(block func(app *v1alpha1.Application)) *Consequences
- func (c *Consequences) AndAction(block func()) *Consequences
- func (c *Consequences) AndCLIOutput(block func(output string, err error)) *Consequences
- func (c *Consequences) Expect(e Expectation) *Consequences
- func (c *Consequences) ExpectConsistently(e Expectation, waitDuration time.Duration, expirationDuration time.Duration) *Consequences
- func (c *Consequences) Given() *Context
- func (c *Consequences) When() *Actions
- type Context
- func (c *Context) And(block func()) *Context
- func (c *Context) AppName() string
- func (c *Context) AppNamespace() string
- func (c *Context) AppQualifiedName() string
- func (c *Context) ApplyOutOfSyncOnly() *Context
- func (c *Context) Async(async bool) *Context
- func (c *Context) AuthenticatedOCIRepoAdded(name, imagePath string) *Context
- func (c *Context) Chart(chart string) *Context
- func (c *Context) CustomCACertAdded() *Context
- func (c *Context) CustomSSHKnownHostsAdded() *Context
- func (c *Context) DestName(destName string) *Context
- func (c *Context) DestServer(destServer string) *Context
- func (c *Context) DrySourcePath(path string) *Context
- func (c *Context) DrySourceRevision(revision string) *Context
- func (c *Context) Env(env string) *Context
- func (c *Context) Force() *Context
- func (c *Context) GPGPublicKeyAdded() *Context
- func (c *Context) GPGPublicKeyRemoved() *Context
- func (c *Context) GetTrackingMethod() v1alpha1.TrackingMethod
- func (c *Context) HTTPSCredentialsTLSClientCertAdded() *Context
- func (c *Context) HTTPSCredentialsUserPassAdded() *Context
- func (c *Context) HTTPSInsecureRepoURLAdded(withCreds bool, opts ...repos.AddRepoOpts) *Context
- func (c *Context) HTTPSInsecureRepoURLWithClientCertAdded() *Context
- func (c *Context) HTTPSRepoURLAdded(withCreds bool, opts ...repos.AddRepoOpts) *Context
- func (c *Context) HTTPSRepoURLWithClientCertAdded() *Context
- func (c *Context) HelmHTTPSCredentialsUserPassAdded() *Context
- func (c *Context) HelmOCIRepoAdded(name string) *Context
- func (c *Context) HelmPassCredentials() *Context
- func (c *Context) HelmRepoAdded(name string) *Context
- func (c *Context) HelmSkipCrds() *Context
- func (c *Context) HelmSkipSchemaValidation() *Context
- func (c *Context) HelmSkipTests() *Context
- func (c *Context) HelmoOCICredentialsWithoutUserPassAdded() *Context
- func (c *Context) HydrateToBranch(branch string) *Context
- func (c *Context) LocalPath(localPath string) *Context
- func (c *Context) Name(name string) *Context
- func (c *Context) NamePrefix(namePrefix string) *Context
- func (c *Context) NameSuffix(nameSuffix string) *Context
- func (c *Context) OCIRegistry(registry string) *Context
- func (c *Context) OCIRegistryPath(ociPath string) *Context
- func (c *Context) OCIRepoAdded(name, imagePath string) *Context
- func (c *Context) Parameter(parameter string) *Context
- func (c *Context) Path(path string) *Context
- func (c *Context) Project(project string) *Context
- func (c *Context) ProjectSpec(spec v1alpha1.AppProjectSpec) *Context
- func (c *Context) Prune(prune bool) *Context
- func (c *Context) PushChartToAuthenticatedOCIRegistry(chartPathName, chartName, chartVersion string) *Context
- func (c *Context) PushChartToOCIRegistry(chartPathName, chartName, chartVersion string) *Context
- func (c *Context) PushImageToAuthenticatedOCIRegistry(pathName, tag string) *Context
- func (c *Context) PushImageToOCIRegistry(pathName, tag string) *Context
- func (c *Context) Recurse() *Context
- func (c *Context) RegisterKustomizeVersion(version, path string) *Context
- func (c *Context) Replace() *Context
- func (c *Context) RepoURLType(urlType fixture.RepoURLType) *Context
- func (c *Context) Resource(content string) *Context
- func (c *Context) ResourceFilter(filter settings.ResourcesFilter) *Context
- func (c *Context) ResourceOverrides(overrides map[string]v1alpha1.ResourceOverride) *Context
- func (c *Context) Revision(revision string) *Context
- func (c *Context) RunningCMPServer(configFile string) *Context
- func (c *Context) SSHCredentialsAdded() *Context
- func (c *Context) SSHInsecureRepoURLAdded(withCreds bool) *Context
- func (c *Context) SSHRepoURLAdded(withCreds bool) *Context
- func (c *Context) SelectedResource(resource string) *Context
- func (c *Context) SetAppNamespace(namespace string) *Context
- func (c *Context) SetInstallationID(installationID string) *Context
- func (c *Context) SetTrackingMethod(trackingMethod string) *Context
- func (c *Context) Sleep(seconds time.Duration) *Context
- func (c *Context) Sources(sources []v1alpha1.ApplicationSource) *Context
- func (c *Context) SubmoduleHTTPSRepoURLAdded(withCreds bool) *Context
- func (c *Context) SubmoduleSSHRepoURLAdded(withCreds bool) *Context
- func (c *Context) SyncSourceBranch(branch string) *Context
- func (c *Context) SyncSourcePath(path string) *Context
- func (c *Context) TagPrefix(tagPrefix string) *Context
- func (c *Context) Timeout(timeout int) *Context
- func (c *Context) When() *Actions
- func (c *Context) WriteCredentials(insecure bool) *Context
- type ContextArgs
- type Expectation
- func App(predicate func(app *v1alpha1.Application) bool) Expectation
- func Condition(conditionType v1alpha1.ApplicationConditionType, conditionMessage string) Expectation
- func DoesNotExist() Expectation
- func DoesNotExistNow() Expectation
- func Error(message, err string, matchers ...func(string, string) bool) Expectation
- func ErrorRegex(messagePattern, err string) Expectation
- func Event(reason string, message string) Expectation
- func HealthIs(expected health.HealthStatusCode) Expectation
- func HydrationPhaseIs(expected v1alpha1.HydrateOperationPhase) Expectation
- func Namespace(name string, block func(app *v1alpha1.Application, ns *corev1.Namespace)) Expectation
- func NamespacedEvent(namespace string, reason string, message string) Expectation
- func NoConditions() Expectation
- func NoNamespace(name string) Expectation
- func NoStatus() Expectation
- func NotPod(predicate func(p corev1.Pod) bool) Expectation
- func OperationMessageContains(text string) Expectation
- func OperationPhaseIs(expected common.OperationPhase) Expectation
- func OperationRetriedMinimumTimes(minRetries int64) Expectation
- func Or(e1 Expectation, e2 Expectation) Expectation
- func Pod(predicate func(p corev1.Pod) bool) Expectation
- func ResourceHealthIs(kind, resource string, expected health.HealthStatusCode) Expectation
- func ResourceHealthWithNamespaceIs(kind, resource, namespace string, expected health.HealthStatusCode) Expectation
- func ResourceResultIs(result v1alpha1.ResourceResult) Expectation
- func ResourceResultMatches(result v1alpha1.ResourceResult) Expectation
- func ResourceResultNumbering(num int) Expectation
- func ResourceSyncStatusIs(kind, resource string, expected v1alpha1.SyncStatusCode) Expectation
- func ResourceSyncStatusWithNamespaceIs(kind, resource, namespace string, expected v1alpha1.SyncStatusCode) Expectation
- func Status(f func(v1alpha1.ApplicationStatus) (bool, string)) Expectation
- func StatusExists() Expectation
- func Success(message string, matchers ...func(string, string) bool) Expectation
- func SuccessRegex(messagePattern string) Expectation
- func SyncStatusIs(expected v1alpha1.SyncStatusCode) Expectation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actions ¶
type Actions struct {
// contains filtered or unexported fields
}
this implements the "when" part of given/when/then
none of the func implement error checks, and that is complete intended, you should check for errors using the Then()
func (*Actions) AddAnnotatedTag ¶ added in v1.8.8
func (*Actions) AddSignedFile ¶ added in v1.8.8
func (*Actions) AddSignedTag ¶ added in v1.8.8
func (*Actions) AddTagWithForce ¶ added in v1.8.8
func (*Actions) ConfirmDeletion ¶ added in v1.8.8
func (*Actions) CreateFromFile ¶ added in v1.2.0
func (a *Actions) CreateFromFile(handler func(app *v1alpha1.Application), flags ...string) *Actions
func (*Actions) CreateFromPartialFile ¶ added in v1.8.8
func (*Actions) CreateMultiSourceApp ¶ added in v1.8.8
func (*Actions) CreateMultiSourceAppFromFile ¶ added in v1.8.8
func (a *Actions) CreateMultiSourceAppFromFile(handler func(app *v1alpha1.Application), flags ...string) *Actions
func (*Actions) CreateWithNoNameSpace ¶ added in v1.8.8
func (*Actions) Declarative ¶
func (*Actions) DeclarativeWithCustomRepo ¶ added in v1.2.0
func (*Actions) DeleteBySelector ¶ added in v1.8.8
func (*Actions) DeleteBySelectorWithWait ¶ added in v1.8.8
func (*Actions) DeleteFile ¶
func (*Actions) DoNotIgnoreErrors ¶ added in v1.3.0
func (*Actions) IgnoreErrors ¶ added in v1.2.0
func (*Actions) PatchAppHttp ¶ added in v1.8.8
func (*Actions) RemoveSubmodule ¶ added in v1.8.8
func (*Actions) SetInstallationID ¶ added in v1.8.8
func (*Actions) SetParamInSettingConfigMap ¶ added in v1.8.8
func (*Actions) SetTrackingLabel ¶ added in v1.8.8
func (*Actions) SetTrackingMethod ¶ added in v1.8.8
func (*Actions) TerminateOp ¶
func (*Actions) Then ¶
func (a *Actions) Then() *Consequences
func (*Actions) WithImpersonationDisabled ¶ added in v1.8.8
func (*Actions) WithImpersonationEnabled ¶ added in v1.8.8
func (a *Actions) WithImpersonationEnabled(serviceAccountName string, policyRules []rbacv1.PolicyRule) *Actions
func (*Actions) WithImpersonationEnforcementDisabled ¶ added in v1.8.8
type Consequences ¶
type Consequences struct {
// contains filtered or unexported fields
}
this implements the "then" part of given/when/then
func (*Consequences) And ¶
func (c *Consequences) And(block func(app *v1alpha1.Application)) *Consequences
func (*Consequences) AndAction ¶ added in v1.8.8
func (c *Consequences) AndAction(block func()) *Consequences
func (*Consequences) AndCLIOutput ¶ added in v1.8.8
func (c *Consequences) AndCLIOutput(block func(output string, err error)) *Consequences
func (*Consequences) Expect ¶
func (c *Consequences) Expect(e Expectation) *Consequences
func (*Consequences) ExpectConsistently ¶ added in v1.8.8
func (c *Consequences) ExpectConsistently(e Expectation, waitDuration time.Duration, expirationDuration time.Duration) *Consequences
ExpectConsistently will continuously evaluate a condition. Once true, it must be true each time it is evaluated, otherwise the test is failed. The condition will be repeatedly evaluated once it is true,until 'expirationDuration' is met, waiting 'waitDuration' after each success.
func (*Consequences) Given ¶
func (c *Consequences) Given() *Context
func (*Consequences) When ¶
func (c *Consequences) When() *Actions
type Context ¶
Context implements the "given" part of given/when/then. It embeds fixture.TestState to provide test-specific state that enables parallel test execution.
func GivenWithNamespace ¶ added in v1.8.8
func GivenWithSameState ¶ added in v1.8.8
func GivenWithSameState(ctx fixture.TestContext) *Context
GivenWithSameState creates a new Context that shares the same TestState as an existing context. Use this when you need multiple fixture contexts within the same test.
func (*Context) AppName ¶ added in v1.8.8
AppName returns the unique application name for the test context. Unique application names protects from potential conflicts between test run caused by the tracking annotation on existing objects
func (*Context) AppNamespace ¶ added in v1.8.8
func (*Context) AppQualifiedName ¶ added in v1.8.8
func (*Context) ApplyOutOfSyncOnly ¶ added in v1.8.8
func (*Context) AuthenticatedOCIRepoAdded ¶ added in v1.8.8
func (*Context) CustomCACertAdded ¶ added in v1.2.0
func (*Context) CustomSSHKnownHostsAdded ¶ added in v1.2.0
func (*Context) DestServer ¶
func (*Context) DrySourcePath ¶ added in v1.8.8
func (*Context) DrySourceRevision ¶ added in v1.8.8
func (*Context) GPGPublicKeyAdded ¶ added in v1.8.8
func (*Context) GPGPublicKeyRemoved ¶ added in v1.8.8
func (*Context) GetTrackingMethod ¶ added in v1.8.8
func (c *Context) GetTrackingMethod() v1alpha1.TrackingMethod
func (*Context) HTTPSCredentialsTLSClientCertAdded ¶ added in v1.4.0
func (*Context) HTTPSCredentialsUserPassAdded ¶ added in v1.4.0
func (*Context) HTTPSInsecureRepoURLAdded ¶ added in v1.2.0
func (c *Context) HTTPSInsecureRepoURLAdded(withCreds bool, opts ...repos.AddRepoOpts) *Context
func (*Context) HTTPSInsecureRepoURLWithClientCertAdded ¶ added in v1.2.0
func (*Context) HTTPSRepoURLAdded ¶ added in v1.2.0
func (c *Context) HTTPSRepoURLAdded(withCreds bool, opts ...repos.AddRepoOpts) *Context
func (*Context) HTTPSRepoURLWithClientCertAdded ¶ added in v1.2.0
func (*Context) HelmHTTPSCredentialsUserPassAdded ¶ added in v1.8.8
func (*Context) HelmOCIRepoAdded ¶ added in v1.8.8
func (*Context) HelmPassCredentials ¶ added in v1.8.8
func (*Context) HelmRepoAdded ¶ added in v1.3.0
func (*Context) HelmSkipCrds ¶ added in v1.8.8
func (*Context) HelmSkipSchemaValidation ¶ added in v1.8.8
func (*Context) HelmSkipTests ¶ added in v1.8.8
func (*Context) HelmoOCICredentialsWithoutUserPassAdded ¶ added in v1.8.8
func (*Context) HydrateToBranch ¶ added in v1.8.8
func (*Context) NamePrefix ¶
func (*Context) NameSuffix ¶ added in v1.4.0
func (*Context) OCIRegistry ¶ added in v1.8.8
func (*Context) OCIRegistryPath ¶ added in v1.8.8
func (*Context) OCIRepoAdded ¶ added in v1.8.8
func (*Context) ProjectSpec ¶ added in v1.3.0
func (c *Context) ProjectSpec(spec v1alpha1.AppProjectSpec) *Context
func (*Context) PushChartToAuthenticatedOCIRegistry ¶ added in v1.8.8
func (*Context) PushChartToOCIRegistry ¶ added in v1.8.8
func (*Context) PushImageToAuthenticatedOCIRegistry ¶ added in v1.8.8
func (*Context) PushImageToOCIRegistry ¶ added in v1.8.8
func (*Context) RegisterKustomizeVersion ¶ added in v1.8.8
func (*Context) RepoURLType ¶ added in v1.2.0
func (c *Context) RepoURLType(urlType fixture.RepoURLType) *Context
func (*Context) ResourceFilter ¶ added in v1.2.0
func (c *Context) ResourceFilter(filter settings.ResourcesFilter) *Context
func (*Context) ResourceOverrides ¶
func (c *Context) ResourceOverrides(overrides map[string]v1alpha1.ResourceOverride) *Context
func (*Context) RunningCMPServer ¶ added in v1.8.8
RunningCMPServer starts a CMP server with the given config directory and waits for it to be ready. It blocks until the CMP socket is created or times out after 10 seconds.
func (*Context) SSHCredentialsAdded ¶ added in v1.4.0
func (*Context) SSHInsecureRepoURLAdded ¶ added in v1.2.0
func (*Context) SSHRepoURLAdded ¶ added in v1.2.0
func (*Context) SelectedResource ¶
group:kind:name
func (*Context) SetAppNamespace ¶ added in v1.8.8
func (*Context) SetInstallationID ¶ added in v1.8.8
func (*Context) SetTrackingMethod ¶ added in v1.8.8
func (*Context) Sources ¶ added in v1.8.8
func (c *Context) Sources(sources []v1alpha1.ApplicationSource) *Context
func (*Context) SubmoduleHTTPSRepoURLAdded ¶ added in v1.4.0
func (*Context) SubmoduleSSHRepoURLAdded ¶ added in v1.4.0
func (*Context) SyncSourceBranch ¶ added in v1.8.8
func (*Context) SyncSourcePath ¶ added in v1.8.8
func (*Context) WriteCredentials ¶ added in v1.8.8
type ContextArgs ¶ added in v1.8.8
type ContextArgs struct {
AppNamespace string
}
type Expectation ¶
type Expectation func(c *Consequences) (state state, message string)
func App ¶ added in v1.8.8
func App(predicate func(app *v1alpha1.Application) bool) Expectation
func Condition ¶
func Condition(conditionType v1alpha1.ApplicationConditionType, conditionMessage string) Expectation
func DoesNotExist ¶
func DoesNotExist() Expectation
func DoesNotExistNow ¶ added in v1.8.8
func DoesNotExistNow() Expectation
func Error ¶
func Error(message, err string, matchers ...func(string, string) bool) Expectation
Error asserts that the last command was an error with substring match
func ErrorRegex ¶ added in v1.8.8
func ErrorRegex(messagePattern, err string) Expectation
ErrorRegex asserts that the last command was an error that matches given regex epxression
func Event ¶
func Event(reason string, message string) Expectation
func HealthIs ¶
func HealthIs(expected health.HealthStatusCode) Expectation
func HydrationPhaseIs ¶ added in v1.8.8
func HydrationPhaseIs(expected v1alpha1.HydrateOperationPhase) Expectation
func Namespace ¶ added in v1.8.8
func Namespace(name string, block func(app *v1alpha1.Application, ns *corev1.Namespace)) Expectation
func NamespacedEvent ¶ added in v1.8.8
func NamespacedEvent(namespace string, reason string, message string) Expectation
func NoConditions ¶ added in v1.3.0
func NoConditions() Expectation
func NoNamespace ¶ added in v1.8.8
func NoNamespace(name string) Expectation
func NoStatus ¶ added in v1.8.8
func NoStatus() Expectation
func OperationMessageContains ¶ added in v1.8.8
func OperationMessageContains(text string) Expectation
func OperationPhaseIs ¶
func OperationPhaseIs(expected common.OperationPhase) Expectation
func OperationRetriedMinimumTimes ¶ added in v1.8.8
func OperationRetriedMinimumTimes(minRetries int64) Expectation
func Or ¶ added in v1.8.8
func Or(e1 Expectation, e2 Expectation) Expectation
func ResourceHealthIs ¶
func ResourceHealthIs(kind, resource string, expected health.HealthStatusCode) Expectation
func ResourceHealthWithNamespaceIs ¶ added in v1.8.8
func ResourceHealthWithNamespaceIs(kind, resource, namespace string, expected health.HealthStatusCode) Expectation
func ResourceResultIs ¶
func ResourceResultIs(result v1alpha1.ResourceResult) Expectation
func ResourceResultMatches ¶ added in v1.8.8
func ResourceResultMatches(result v1alpha1.ResourceResult) Expectation
func ResourceResultNumbering ¶
func ResourceResultNumbering(num int) Expectation
func ResourceSyncStatusIs ¶
func ResourceSyncStatusIs(kind, resource string, expected v1alpha1.SyncStatusCode) Expectation
func ResourceSyncStatusWithNamespaceIs ¶ added in v1.8.8
func ResourceSyncStatusWithNamespaceIs(kind, resource, namespace string, expected v1alpha1.SyncStatusCode) Expectation
func Status ¶ added in v1.8.8
func Status(f func(v1alpha1.ApplicationStatus) (bool, string)) Expectation
func StatusExists ¶ added in v1.8.8
func StatusExists() Expectation
func Success ¶
func Success(message string, matchers ...func(string, string) bool) Expectation
Success asserts that the last command was successful and that the output contains the given message.
func SuccessRegex ¶ added in v1.8.8
func SuccessRegex(messagePattern string) Expectation
SuccessRegex asserts that the last command was successful and output matches given regex expression
func SyncStatusIs ¶
func SyncStatusIs(expected v1alpha1.SyncStatusCode) Expectation