Documentation
¶
Index ¶
- Constants
- func CleanupAllPortForwards()
- func ClearRouteCache()
- func ConstructServiceURL(serviceName, namespace, port, path string) string
- func EnsurePortForward(serviceName, namespace, remotePort string) (int, error)
- func ExecuteBitbucket(t *testing.T, step TestStep, tmplData TemplateData, config map[string]string, ...)
- func ExecuteBuild(t *testing.T, step TestStep, testdataPath string, tmplData TemplateData, ...)
- func ExecuteExposeService(t *testing.T, step TestStep, tmplData TemplateData, projectName string)
- func ExecuteHTTP(t *testing.T, step TestStep, testdataPath string, tmplData TemplateData)
- func ExecuteInspect(t *testing.T, step TestStep, testdataPath string, tmplData TemplateData, ...)
- func ExecuteProvision(t *testing.T, step TestStep, testdataPath string, tmplData TemplateData, ...)
- func ExecuteRun(t *testing.T, step TestStep, testdataPath string, tmplData TemplateData, ...)
- func ExecuteUpload(t *testing.T, step TestStep, testdataPath string, tmplData TemplateData, ...)
- func ExecuteWait(t *testing.T, step TestStep, testdataPath string, tmplData TemplateData, ...)
- func GetActivePortForwards() []string
- func GetServicePort(serviceName, namespace string) (string, error)
- func ResolveServiceURL(t *testing.T, rawURL string, tmplData TemplateData) string
- func ShouldSkipStep(t *testing.T, step *TestStep, tmplData TemplateData) bool
- func WaitForServiceReady(serviceName, namespace string, timeout time.Duration) error
- type BitbucketHandler
- type BitbucketPRVerification
- type BitbucketPullRequest
- type BitbucketRepositoriesResponse
- type BitbucketRepository
- type BuildHandler
- type ExecutionParams
- type ExposeServiceConfig
- type ExposeServiceHandler
- type HTTPAssertion
- type HTTPHandler
- type HTTPRetry
- type InspectChecks
- type InspectHandler
- type LogChecks
- type PortForward
- type PortForwardManager
- type ProvisionHandler
- type ResourceChecks
- type ResourceValues
- type RouteCache
- type RunHandler
- type ServiceURL
- type StepExecutor
- type StepHandler
- type StepRegistry
- type StepRetryConfig
- type TemplateData
- type TestStep
- type TestStepBitbucketParams
- type TestStepBitbucketVerify
- type TestStepBuildParams
- type TestStepExposeServiceParams
- type TestStepHTTPParams
- type TestStepInspectParams
- type TestStepProvisionParams
- type TestStepRunParams
- type TestStepUploadParams
- type TestStepVerify
- type TestStepWaitParams
- type UploadHandler
- type VerificationContext
- type WaitHandler
Constants ¶
const ( StepTypeUpload = "upload" StepTypeRun = "run" StepTypeProvision = "provision" StepTypeBuild = "build" StepTypeHTTP = "http" StepTypeWait = "wait" StepTypeInspect = "inspect" StepTypeExposeService = "expose-service" StepTypeBitbucket = "bitbucket" )
Step type constants
const ( DefaultBranch = "master" DefaultJenkinsfile = "Jenkinsfile" DefaultNamespace = "dev" )
Default values
const ( VerifyStrategyAggregate = "aggregate" VerifyStrategyFailFast = "fail-fast" )
Verification strategies
const ( WaitConditionPodReady = "pod-ready" WaitConditionDeploymentComplete = "deployment-complete" WaitConditionJobComplete = "job-complete" WaitConditionRouteAccessible = "route-accessible" WaitConditionHTTPAccessible = "http-accessible" WaitConditionLogContains = "log-contains" )
Wait condition constants
Variables ¶
This section is empty.
Functions ¶
func CleanupAllPortForwards ¶
func CleanupAllPortForwards()
CleanupAllPortForwards terminates all active port-forwards
func ClearRouteCache ¶
func ClearRouteCache()
ClearRouteCache clears the route cache (useful for testing)
func ConstructServiceURL ¶
ConstructServiceURL builds a standard internal service URL
func EnsurePortForward ¶
EnsurePortForward ensures a port-forward exists for the given service Returns the local port number that can be used to access the service
func ExecuteBitbucket ¶
func ExecuteBitbucket(t *testing.T, step TestStep, tmplData TemplateData, config map[string]string, projectName string, testdataPath string)
ExecuteBitbucket handles the bitbucket step type for Bitbucket interactions.
func ExecuteBuild ¶
func ExecuteBuild(t *testing.T, step TestStep, testdataPath string, tmplData TemplateData, repoName string, config map[string]string, projectName string)
ExecuteBuild handles the build step type.
func ExecuteExposeService ¶
func ExecuteExposeService(t *testing.T, step TestStep, tmplData TemplateData, projectName string)
ExecuteExposeService handles the expose-service step type. This step explicitly exposes services by setting up routes or port-forwards based on the execution environment.
func ExecuteHTTP ¶
func ExecuteHTTP(t *testing.T, step TestStep, testdataPath string, tmplData TemplateData)
ExecuteHTTP handles the http step type for testing HTTP endpoints.
func ExecuteInspect ¶
func ExecuteInspect(t *testing.T, step TestStep, testdataPath string, tmplData TemplateData, projectName string)
ExecuteInspect handles the inspect step type for inspecting container runtime behavior.
func ExecuteProvision ¶
func ExecuteProvision(t *testing.T, step TestStep, testdataPath string, tmplData TemplateData, repoName string, quickstarterRepo string, quickstarterName string, config map[string]string, projectName string)
ExecuteProvision handles the provision step type.
func ExecuteRun ¶
func ExecuteRun(t *testing.T, step TestStep, testdataPath string, tmplData TemplateData, projectName string)
ExecuteRun handles the run step type.
func ExecuteUpload ¶
func ExecuteUpload(t *testing.T, step TestStep, testdataPath string, tmplData TemplateData, repoName string, config map[string]string, projectName string)
ExecuteUpload handles the upload step type.
func ExecuteWait ¶
func ExecuteWait(t *testing.T, step TestStep, testdataPath string, tmplData TemplateData, projectName string)
ExecuteWait handles the wait step type for waiting on asynchronous operations.
func GetActivePortForwards ¶
func GetActivePortForwards() []string
GetActivePortForwards returns information about active port-forwards (for debugging)
func GetServicePort ¶
GetServicePort retrieves the primary port for a service
func ResolveServiceURL ¶
func ResolveServiceURL(t *testing.T, rawURL string, tmplData TemplateData) string
ResolveServiceURL intelligently resolves a service URL based on execution environment Strategy: 1. If URL is not an internal service URL (.svc.cluster.local), return as-is 2. Check if a route exists for the service -> use route URL 3. If running in cluster (Jenkins) -> use internal service DNS 4. If running locally -> setup port-forward and use localhost
func ShouldSkipStep ¶
func ShouldSkipStep(t *testing.T, step *TestStep, tmplData TemplateData) bool
ShouldSkipStep determines if a step should be skipped.
Types ¶
type BitbucketHandler ¶
type BitbucketHandler struct{}
BitbucketHandler implements the handler for bitbucket steps.
func (*BitbucketHandler) Execute ¶
func (h *BitbucketHandler) Execute(t *testing.T, step *TestStep, params *ExecutionParams) error
type BitbucketPRVerification ¶
type BitbucketPRVerification struct {
JSONPath string // JSON path like ".title", ".state", ".fromRef.displayId"
ExpectedValue interface{} // Expected value (string, bool, int, etc.)
Description string // Human-readable description of what's being checked
}
BitbucketPRVerification represents a verification rule for PR content
type BitbucketPullRequest ¶
type BitbucketPullRequest struct {
ID int `json:"id"`
Version int `json:"version"`
Title string `json:"title"`
Description string `json:"description"`
State string `json:"state"`
Open bool `json:"open"`
Closed bool `json:"closed"`
FromRef struct {
ID string `json:"id"`
DisplayID string `json:"displayId"`
LatestCommit string `json:"latestCommit"`
} `json:"fromRef"`
ToRef struct {
ID string `json:"id"`
DisplayID string `json:"displayId"`
LatestCommit string `json:"latestCommit"`
} `json:"toRef"`
Author struct {
User struct {
Name string `json:"name"`
} `json:"user"`
} `json:"author"`
// Raw JSON for flexible querying
RawJSON map[string]interface{} `json:"-"`
}
BitbucketPullRequest represents a Bitbucket pull request response
type BitbucketRepositoriesResponse ¶
type BitbucketRepositoriesResponse struct {
Values []BitbucketRepository `json:"values"`
}
BitbucketRepositoriesResponse represents the list of repositories response
type BitbucketRepository ¶
type BitbucketRepository struct {
Slug string `json:"slug"`
}
BitbucketRepository represents a Bitbucket repository
type BuildHandler ¶
type BuildHandler struct{}
BuildHandler implements the handler for build steps.
func (*BuildHandler) Execute ¶
func (h *BuildHandler) Execute(t *testing.T, step *TestStep, params *ExecutionParams) error
type ExecutionParams ¶
type ExecutionParams struct {
TestdataPath string // Path to the testdata directory
TmplData TemplateData // Template variables for rendering
RepoName string // Repository name (format: project-component)
QuickstarterRepo string // Quickstarter repository name
QuickstarterName string // Quickstarter name
Config map[string]string // Configuration key-value pairs
ProjectName string // OpenShift project name
}
ExecutionParams consolidates all parameters needed for step execution. This struct provides a unified interface for passing context to step handlers, making it easier to add new parameters without changing handler signatures.
When adding new commonly-needed parameters, extend this struct rather than changing individual step function signatures.
type ExposeServiceConfig ¶
type ExposeServiceConfig struct {
// Name of the service to expose
ServiceName string `json:"serviceName"`
// Namespace where the service is located (supports templating, defaults to {{.ProjectID}}-dev)
Namespace string `json:"namespace"`
// Port to expose (defaults to 8080)
Port string `json:"port"`
}
ExposeServiceConfig defines a single service to expose
type ExposeServiceHandler ¶
type ExposeServiceHandler struct{}
ExposeServiceHandler implements the handler for expose-service steps.
func (*ExposeServiceHandler) Execute ¶
func (h *ExposeServiceHandler) Execute(t *testing.T, step *TestStep, params *ExecutionParams) error
type HTTPAssertion ¶
type HTTPAssertion struct {
// JSONPath expression
Path string `json:"path"`
// Expected value (exact match)
Equals interface{} `json:"equals"`
// Check if path exists
Exists *bool `json:"exists"`
// Check if value contains string
Contains string `json:"contains"`
// Check if value matches regex
Matches string `json:"matches"`
}
HTTPAssertion defines a JSONPath-based assertion
type HTTPHandler ¶
type HTTPHandler struct{}
HTTPHandler implements the handler for HTTP steps.
func (*HTTPHandler) Execute ¶
func (h *HTTPHandler) Execute(t *testing.T, step *TestStep, params *ExecutionParams) error
type HTTPRetry ¶
type HTTPRetry struct {
// Number of retry attempts
Attempts int `json:"attempts"`
// Delay between retries (e.g., "2s", "500ms")
Delay string `json:"delay"`
}
HTTPRetry defines retry configuration for HTTP requests
type InspectChecks ¶
type InspectChecks struct {
// Log content checks
Logs *LogChecks `json:"logs"`
// Environment variable checks
Env map[string]string `json:"env"`
// Resource limit checks
Resources *ResourceChecks `json:"resources"`
}
InspectChecks defines what to check in the container
type InspectHandler ¶
type InspectHandler struct{}
InspectHandler implements the handler for inspect steps.
func (*InspectHandler) Execute ¶
func (h *InspectHandler) Execute(t *testing.T, step *TestStep, params *ExecutionParams) error
type LogChecks ¶
type LogChecks struct {
// Log should contain these strings
Contains []string `json:"contains"`
// Log should NOT contain these strings
NotContains []string `json:"notContains"`
// Log should match these regex patterns
Matches []string `json:"matches"`
}
LogChecks defines log content assertions
type PortForward ¶
type PortForward struct {
ServiceName string
Namespace string
RemotePort string
LocalPort int
Cmd *exec.Cmd
Started time.Time
}
PortForward represents a single port-forward session
type PortForwardManager ¶
type PortForwardManager struct {
// contains filtered or unexported fields
}
PortForwardManager manages the lifecycle of port-forwards for local development
type ProvisionHandler ¶
type ProvisionHandler struct{}
ProvisionHandler implements the handler for provision steps.
func (*ProvisionHandler) Execute ¶
func (h *ProvisionHandler) Execute(t *testing.T, step *TestStep, params *ExecutionParams) error
type ResourceChecks ¶
type ResourceChecks struct {
// Resource limits
Limits *ResourceValues `json:"limits"`
// Resource requests
Requests *ResourceValues `json:"requests"`
}
ResourceChecks defines resource limit/request checks
type ResourceValues ¶
ResourceValues defines CPU and memory values
type RouteCache ¶
type RouteCache struct {
// contains filtered or unexported fields
}
RouteCache caches route lookups to avoid repeated queries
type RunHandler ¶
type RunHandler struct{}
RunHandler implements the handler for run steps.
func (*RunHandler) Execute ¶
func (h *RunHandler) Execute(t *testing.T, step *TestStep, params *ExecutionParams) error
type ServiceURL ¶
type ServiceURL struct {
ServiceName string
Namespace string
Port string
Path string
Scheme string
}
ServiceURL represents a parsed internal service URL
type StepExecutor ¶
type StepExecutor struct {
// contains filtered or unexported fields
}
StepExecutor handles step execution with lifecycle hooks and retry logic.
func NewStepExecutor ¶
func NewStepExecutor(testdataPath string, tmplData TemplateData) *StepExecutor
NewStepExecutor creates a new step executor.
func (*StepExecutor) ExecuteWithHooks ¶
func (se *StepExecutor) ExecuteWithHooks( t *testing.T, step *TestStep, handler func() error, ) error
ExecuteWithHooks executes a step with before/after hooks.
type StepHandler ¶
type StepHandler interface {
// Execute runs the step logic with the given parameters.
// Returns an error if the step execution fails.
Execute(t *testing.T, step *TestStep, params *ExecutionParams) error
}
StepHandler defines the interface that all step handlers must implement. This allows for a clean registry pattern where steps can be registered and executed polymorphically.
Implementations should delegate to specific Execute* functions (e.g., ExecuteUpload, ExecuteRun) which contain the actual step logic.
type StepRegistry ¶
type StepRegistry struct {
// contains filtered or unexported fields
}
StepRegistry manages the mapping of step types to their handlers. It provides thread-safe registration and retrieval of step handlers, enabling a plugin-like architecture for step types.
func DefaultRegistry ¶
func DefaultRegistry() *StepRegistry
DefaultRegistry returns the singleton global step registry.
func NewStepRegistry ¶
func NewStepRegistry() *StepRegistry
NewStepRegistry creates a new empty step registry.
func (*StepRegistry) Get ¶
func (r *StepRegistry) Get(stepType string) (StepHandler, error)
Get retrieves the handler for a specific step type. Returns an error if no handler is registered for the given type.
func (*StepRegistry) Register ¶
func (r *StepRegistry) Register(stepType string, handler StepHandler)
Register adds a handler for a specific step type. If a handler already exists for the given type, it will be overwritten.
type StepRetryConfig ¶
type StepRetryConfig struct {
// Number of retry attempts (0 = no retries)
Attempts int `json:"attempts"`
// Delay between retries (e.g., "2s", "500ms")
Delay string `json:"delay"`
// Only retry on transient errors (timeout, connection issues)
OnlyTransient bool `json:"onlyTransient"`
}
StepRetryConfig defines retry behavior for a step.
type TemplateData ¶
type TemplateData map[string]interface{}
TemplateData holds template parameters. Those will be applied to all values defined in the steps, as they are treated as Go templates.
func CreateTemplateData ¶
func CreateTemplateData(config map[string]string, componentID string, buildName string, projectName string) TemplateData
CreateTemplateData creates the template data map for rendering templates
type TestStep ¶
type TestStep struct {
// Type of the step - one of "build", "provision", "upload", "run", "http", "wait", "inspect", "expose-service"
Type string `json:"type"`
// Optional description to explain the step's purpose
Description string `json:"description"`
// ComponentID name for that step (overwrites global component name)
ComponentID string `json:"componentID"`
// Skip this step if true (supports templating)
Skip bool `json:"skip"`
// Skip condition - skip this step if this expression evaluates to true (supports templating)
SkipIf string `json:"skipIf"`
// Timeout for this step in seconds (step-specific override)
Timeout int `json:"timeout"`
// Retry configuration for this step
Retry *StepRetryConfig `json:"retry"`
// Hook to execute before this step (file path relative to testdata)
BeforeStep string `json:"beforeStep"`
// Hook to execute after this step (file path relative to testdata)
AfterStep string `json:"afterStep"`
// Parameters for "provison" step type
ProvisionParams *TestStepProvisionParams `json:"provisionParams"`
// Parameters for "build" step type
BuildParams *TestStepBuildParams `json:"buildParams"`
// Parameters for "upload" step type
UploadParams *TestStepUploadParams `json:"uploadParams"`
// Parameters for "run" step type
RunParams *TestStepRunParams `json:"runParams"`
// Parameters for "http" step type
HTTPParams *TestStepHTTPParams `json:"httpParams"`
// Parameters for "wait" step type
WaitParams *TestStepWaitParams `json:"waitParams"`
// Parameters for "inspect" step type
InspectParams *TestStepInspectParams `json:"inspectParams"`
// Parameters for "expose-service" step type
ExposeServiceParams *TestStepExposeServiceParams `json:"exposeServiceParams"`
// Parameters for "bitbucket" step type
BitbucketParams *TestStepBitbucketParams `json:"bitbucketParams"`
}
TestStep describes one step to execute. A step consists of a type (e.g. "build"), and the related params for it (e.g. "buildParams").
type TestStepBitbucketParams ¶
type TestStepBitbucketParams struct {
// Action to perform: "recreate-repo", "approve-pr", "get-pullrequest", "delete-files", or "upload-file"
Action string `json:"action"`
// Repository slug
Repository string `json:"repository"`
// Project key (required for recreate-repo, optional for approve-pr, delete-files, and upload-file)
Project string `json:"project"`
// Pull request ID (required for approve-pr and get-pullrequest actions)
PullRequestID string `json:"pullRequestID"`
// Reviewer username to add as reviewer (optional for approve-pr action)
Reviewer string `json:"reviewer"`
// Paths to delete (required for delete-files action, supports templating)
Paths []string `json:"paths"`
// Commit message for delete-files action (defaults to "Remove files/folders")
CommitMessage string `json:"commitMessage"`
// File to upload (relative to "testdata" directory) for upload-file action
File string `json:"file"`
// Name of the uploaded file in the repository (defaults to the basename of File)
Filename string `json:"filename"`
// Render the file as a Go template before uploading (upload-file action)
Render bool `json:"render"`
// Verify contains verification rules for PR content
Verify *TestStepBitbucketVerify `json:"verify"`
}
type TestStepBitbucketVerify ¶
type TestStepBitbucketVerify struct {
// PRChecks contains JSON path-based checks for PR content
PRChecks map[string]interface{} `json:"prChecks"`
}
TestStepBitbucketVerify defines verification rules for Bitbucket operations
type TestStepBuildParams ¶
type TestStepBuildParams TestStepProvisionParams
TestStepBuildParams defines the parameters for the "build" step type.
type TestStepExposeServiceParams ¶
type TestStepExposeServiceParams struct {
// Services to expose (list of service configurations)
Services []ExposeServiceConfig `json:"services"`
}
TestStepExposeServiceParams defines the parameters for the "expose-service" step type.
type TestStepHTTPParams ¶
type TestStepHTTPParams struct {
// URL to test (supports templating)
URL string `json:"url"`
// HTTP method (GET, POST, PUT, DELETE, etc.)
Method string `json:"method"`
// Request headers
Headers map[string]string `json:"headers"`
// Request body
Body string `json:"body"`
// Expected HTTP status code
ExpectedStatus int `json:"expectedStatus"`
// Path to golden file with expected response body (relative to "testdata" directory)
ExpectedBody string `json:"expectedBody"`
// JSONPath assertions
Assertions []HTTPAssertion `json:"assertions"`
// Timeout in seconds
Timeout int `json:"timeout"`
// Retry configuration
Retry *HTTPRetry `json:"retry"`
}
TestStepHTTPParams defines the parameters for the "http" step type.
type TestStepInspectParams ¶
type TestStepInspectParams struct {
// Resource to inspect (e.g., "deployment/my-app", "pod/my-pod")
Resource string `json:"resource"`
// Namespace (defaults to {{.ProjectID}}-dev)
Namespace string `json:"namespace"`
// Checks to perform
Checks *InspectChecks `json:"checks"`
}
TestStepInspectParams defines the parameters for the "inspect" step type.
type TestStepProvisionParams ¶
type TestStepProvisionParams struct {
// Name of the quickstarter to provision.
Quickstarter string `json:"quickstarter"`
// Pipeline allows to customize the pipeline name.
// If empty, the pipeline name is generated.
Pipeline string `json:"pipeline"`
// Quickstarter branch for which to run the pipeline.
// For "provision" steps, it defaults to ODS_GIT_REF.
// For "build" steps, it defaults to "master".
Branch string `json:"branch"`
// Jenkins Agent image tag.
// Defaults to ODS_IMAGE_TAG.
AgentImageTag string `json:"agentImageTag"`
// Defaults to AgentImageTag.
SharedLibraryRef string `json:"sharedLibraryRef"`
// Additional environment variables
Env []utils.EnvPair `json:"env"`
// Verify parameters.
Verify *TestStepVerify `json:"verify"`
// In case we want to override the repository, it is relative to the project where we run it.
Repository string `json:"repository"`
// Extra resources to remove
TestResourcesCleanUp []struct {
// Type of the resource
ResourceType string `json:"resourceType"`
// Name of the resource
ResourceName string `json:"resourceName"`
// Namespace
Namespace string `json:"namespace"`
} `json:"testResourcesCleanUp"`
}
TestStepProvisionParams defines the parameters for the "provision" step type.
type TestStepRunParams ¶
type TestStepRunParams struct {
// File to execute relative to "testdata" directory
File string `json:"file"`
// Services is an optional map of service name aliases to actual service names.
// This allows scripts to access multiple exposed services via named environment variables.
// Example: {"backend": "my-backend-svc", "frontend": "{{.ComponentID}}-frontend"}
// Will create: BACKEND_SERVICE_URL and FRONTEND_SERVICE_URL environment variables.
Services map[string]string `json:"services"`
}
TestStepRunParams defines the parameters for the "run" step type.
type TestStepUploadParams ¶
type TestStepUploadParams struct {
// File to add, commit and push to the repository (relative to "testdata" directory)
File string `json:"file"`
// Name of the uploaded file in the repository. Defaults to just the filename of +File+.
Filename string `json:"filename"`
// In case this is a template file that we want to render.
Render bool `json:"render"`
// In case we want to override the repository, it is relative to the project where we run it.
Repository string `json:"repository"`
}
TestStepUploadParams defines the parameters for the "upload" step type.
type TestStepVerify ¶
type TestStepVerify struct {
// Verification strategy: "aggregate" (default) collects all failures; "fail-fast" stops on first.
Strategy string `json:"strategy"`
// JSON file defining expected Jenkins stages (relative to "testdata" directory).
JenkinsStages string `json:"jenkinsStages"`
// JSON file defining expected Sonar scan result (relative to "testdata" directory).
SonarScan string `json:"sonarScan"`
// Names of expected attachments to the Jenkins run.
RunAttachments []string `json:"runAttachments"`
// Number of expected test results.
TestResults int `json:"testResults"`
// Expected OpenShift resources in the *-dev namespace.
OpenShiftResources *struct {
// Namespace in which to look for resources (defaults to *-dev).
Namespace string `json:"namespace"`
// Image tags
ImageTags []struct {
// Name of the image
Name string `json:"name"`
// Tag of the image
Tag string `json:"tag"`
} `json:"imageTags"`
// BuildConfig resources (OpenShift)
BuildConfigs []string `json:"buildConfigs"`
// ImageStream resources (OpenShift)
ImageStreams []string `json:"imageStreams"`
// DeploymentConfig resources (OpenShift)
DeploymentConfigs []string `json:"deploymentConfigs"`
// Deployment resources (Kubernetes)
Deployments []string `json:"deployments"`
// StatefulSet resources (Kubernetes)
StatefulSets []string `json:"statefulSets"`
// DaemonSet resources (Kubernetes)
DaemonSets []string `json:"daemonSets"`
// ReplicaSet resources (Kubernetes)
ReplicaSets []string `json:"replicaSets"`
// Service resources. The check includes verifying that a running, ready pod is assigned.
Services []string `json:"services"`
// Route resources (OpenShift)
Routes []string `json:"routes"`
// Ingress resources (Kubernetes)
Ingresses []string `json:"ingresses"`
// ConfigMap resources
ConfigMaps []string `json:"configMaps"`
// Secret resources
Secrets []string `json:"secrets"`
// PersistentVolumeClaim resources
PersistentVolumeClaims []string `json:"persistentVolumeClaims"`
// ServiceAccount resources
ServiceAccounts []string `json:"serviceAccounts"`
// Role resources
Roles []string `json:"roles"`
// RoleBinding resources
RoleBindings []string `json:"roleBindings"`
// NetworkPolicy resources
NetworkPolicies []string `json:"networkPolicies"`
// Job resources
Jobs []string `json:"jobs"`
// CronJob resources
CronJobs []string `json:"cronJobs"`
// Pod resources
Pods []string `json:"pods"`
// HorizontalPodAutoscaler resources
HorizontalPodAutoscalers []string `json:"horizontalPodAutoscalers"`
} `json:"openShiftResources"`
}
TestStepVerify defines the items to verify.
type TestStepWaitParams ¶
type TestStepWaitParams struct {
// Type of wait condition
Condition string `json:"condition"`
// Resource to wait for (for OpenShift resources)
Resource string `json:"resource"`
// URL to wait for (for http-accessible condition)
URL string `json:"url"`
// Log message to wait for (for log-contains condition)
Message string `json:"message"`
// Namespace (defaults to {{.ProjectID}}-dev)
Namespace string `json:"namespace"`
// Timeout duration (e.g., "300s", "5m")
Timeout string `json:"timeout"`
// Polling interval (e.g., "5s")
Interval string `json:"interval"`
}
TestStepWaitParams defines the parameters for the "wait" step type.
type UploadHandler ¶
type UploadHandler struct{}
UploadHandler implements the handler for upload steps.
func (*UploadHandler) Execute ¶
func (h *UploadHandler) Execute(t *testing.T, step *TestStep, params *ExecutionParams) error
type VerificationContext ¶
type VerificationContext struct {
TestdataPath string
RepoName string
BuildName string
Config map[string]string
TmplData TemplateData
ProjectName string
}
VerificationContext holds context for verifications
type WaitHandler ¶
type WaitHandler struct{}
WaitHandler implements the handler for wait steps.
func (*WaitHandler) Execute ¶
func (h *WaitHandler) Execute(t *testing.T, step *TestStep, params *ExecutionParams) error