Documentation
¶
Overview ¶
Package config contains configuration options for configuring uptest runtime.
Package config contains configuration options for configuring uptest runtime.
Index ¶
- Constants
- type AutomatedTest
- type Builder
- func (b *Builder) Build() *AutomatedTest
- func (b *Builder) SetDataSourcePath(dataSourcePath string) *Builder
- func (b *Builder) SetDefaultConditions(defaultConditions []string) *Builder
- func (b *Builder) SetDefaultTimeout(defaultTimeout time.Duration) *Builder
- func (b *Builder) SetDirectory(directory string) *Builder
- func (b *Builder) SetLogCollectionInterval(logCollectionInterval time.Duration) *Builder
- func (b *Builder) SetManifestPaths(manifestPaths []string) *Builder
- func (b *Builder) SetOnlyCleanUptestResources(onlyCleanUptestResources bool) *Builder
- func (b *Builder) SetRenderOnly(renderOnly bool) *Builder
- func (b *Builder) SetSetupScriptPath(setupScriptPath string) *Builder
- func (b *Builder) SetSkipDelete(skipDelete bool) *Builder
- func (b *Builder) SetSkipImport(skipImport bool) *Builder
- func (b *Builder) SetSkipUpdate(skipUpdate bool) *Builder
- func (b *Builder) SetTeardownScriptPath(teardownScriptPath string) *Builder
- func (b *Builder) SetUseLibraryMode(useLibraryMode bool) *Builder
- type Manifest
- type Resource
- type TestCase
Constants ¶
const ( // AnnotationKeyTimeout defines a test time for the annotated resource. AnnotationKeyTimeout = "uptest.upbound.io/timeout" // AnnotationKeyConditions defines the list of status conditions to // assert on the tested resource. AnnotationKeyConditions = "uptest.upbound.io/conditions" // AnnotationKeyPreAssertHook defines the path to a pre-assert // hook script to be executed before the resource is tested. AnnotationKeyPreAssertHook = "uptest.upbound.io/pre-assert-hook" // AnnotationKeyPostAssertHook defines the path to a post-assert // hook script to be executed after the resource is tested. AnnotationKeyPostAssertHook = "uptest.upbound.io/post-assert-hook" // AnnotationKeyPreDeleteHook defines the path to a pre-delete // hook script to be executed before the tested resource is deleted. AnnotationKeyPreDeleteHook = "uptest.upbound.io/pre-delete-hook" // AnnotationKeyPostDeleteHook defines the path to a post-delete // hook script to be executed after the tested resource is deleted. AnnotationKeyPostDeleteHook = "uptest.upbound.io/post-delete-hook" // AnnotationKeyUpdateParameter defines the update parameter that will be // used during the update step AnnotationKeyUpdateParameter = "uptest.upbound.io/update-parameter" // AnnotationKeyExampleID is id of example that populated from example // manifest. This information will be used for determining the root resource AnnotationKeyExampleID = "meta.upbound.io/example-id" // AnnotationKeyDisableImport determines whether the Import // step of the resource to be tested will be executed or not. AnnotationKeyDisableImport = "uptest.upbound.io/disable-import" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutomatedTest ¶
type AutomatedTest struct {
Directory string
ManifestPaths []string
DataSourcePath string
SetupScriptPath string
TeardownScriptPath string
DefaultTimeout time.Duration
DefaultConditions []string
SkipDelete bool
SkipUpdate bool
SkipImport bool
OnlyCleanUptestResources bool
RenderOnly bool
LogCollectionInterval time.Duration
UseLibraryMode bool
}
AutomatedTest represents an automated test of resource example manifests to be run with uptest.
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is a struct that helps construct an AutomatedTest instance step-by-step.
func NewBuilder ¶
func NewBuilder() *Builder
NewBuilder initializes and returns a new Builder instance.
func (*Builder) Build ¶
func (b *Builder) Build() *AutomatedTest
Build finalizes and returns the constructed AutomatedTest instance.
func (*Builder) SetDataSourcePath ¶
SetDataSourcePath sets the data source path for the AutomatedTest and returns the Builder.
func (*Builder) SetDefaultConditions ¶
SetDefaultConditions sets the default conditions for the AutomatedTest and returns the Builder.
func (*Builder) SetDefaultTimeout ¶
SetDefaultTimeout sets the default timeout duration for the AutomatedTest and returns the Builder.
func (*Builder) SetDirectory ¶
SetDirectory sets the directory path for the AutomatedTest and returns the Builder.
func (*Builder) SetLogCollectionInterval ¶
SetLogCollectionInterval sets the interval for log collection during the AutomatedTest and returns the Builder.
func (*Builder) SetManifestPaths ¶
SetManifestPaths sets the paths of the manifest files for the AutomatedTest and returns the Builder.
func (*Builder) SetOnlyCleanUptestResources ¶
SetOnlyCleanUptestResources sets whether the AutomatedTest should clean up only test-specific resources and returns the Builder.
func (*Builder) SetRenderOnly ¶
SetRenderOnly sets whether the AutomatedTest should only render outputs without execution and returns the Builder.
func (*Builder) SetSetupScriptPath ¶
SetSetupScriptPath sets the setup script path for the AutomatedTest and returns the Builder.
func (*Builder) SetSkipDelete ¶
SetSkipDelete sets whether the AutomatedTest should skip resource deletion and returns the Builder.
func (*Builder) SetSkipImport ¶
SetSkipImport sets whether the AutomatedTest should skip resource imports and returns the Builder.
func (*Builder) SetSkipUpdate ¶
SetSkipUpdate sets whether the AutomatedTest should skip resource updates and returns the Builder.
func (*Builder) SetTeardownScriptPath ¶
SetTeardownScriptPath sets the teardown script path for the AutomatedTest and returns the Builder.
func (*Builder) SetUseLibraryMode ¶
SetUseLibraryMode sets whether the AutomatedTest should use library mode instead of CLI fork mode and returns the Builder.
type Manifest ¶
type Manifest struct {
FilePath string
Object *unstructured.Unstructured
YAML string
}
Manifest represents a resource loaded from an example resource manifest file.
type Resource ¶
type Resource struct {
Name string
Namespace string
KindGroup string
YAML string
APIVersion string
Kind string
Timeout time.Duration
Conditions []string
PreAssertScriptPath string
PostAssertScriptPath string
PreDeleteScriptPath string
PostDeleteScriptPath string
UpdateParameter string
UpdateAssertKey string
UpdateAssertValue string
SkipImport bool
Root bool
}
Resource represents a Kubernetes object to be tested and asserted by uptest.