Documentation
¶
Index ¶
Constants ¶
const ( ContainerLogPathEnvVar = "RADIUS_CONTAINER_LOG_PATH" APIVersion = "2023-10-01-preview" TestNamespace = "kind-radius" AWSDeletionRetryLimit = 5 )
Variables ¶
This section is empty.
Functions ¶
func K8sSecretResource ¶
func K8sSecretResource(namespace, name, secretType string, kv ...any) unstructured.Unstructured
K8sSecretResource creates the secret resource from the given namespace, name, secretType and key-value pairs, for Initial Resource in NewRPTest().
Types ¶
type RPTest ¶
type RPTest struct {
Options RPTestOptions
Name string
Description string
InitialResources []unstructured.Unstructured
Steps []TestStep
PostDeleteVerify func(ctx context.Context, t *testing.T, ct RPTest)
// RequiredFeatures specifies the optional features that are required
// for this test to run.
RequiredFeatures []RequiredFeature
}
func NewRPTest ¶
func NewRPTest(t *testing.T, name string, steps []TestStep, initialResources ...unstructured.Unstructured) RPTest
NewRPTest creates a new RPTest instance with the given name, steps and initial resources.
func (RPTest) CheckRequiredFeatures ¶
CheckRequiredFeatures checks the test environment for the features that the test requires and skips the test if not, otherwise returns an error if there is an issue.
func (RPTest) CleanUpExtensionResources ¶
func (ct RPTest) CleanUpExtensionResources(resources []unstructured.Unstructured)
Method CleanUpExtensionResources deletes all resources in the given slice of unstructured objects.
func (RPTest) CreateInitialResources ¶
CreateInitialResources creates a namespace and creates initial resources from the InitialResources field of the RPTest struct. It returns an error if either of these operations fail.
type RPTestOptions ¶
type RPTestOptions struct {
test.TestOptions
CustomAction *clientv2.CustomActionClient
ManagementClient clients.ApplicationsManagementClient
AWSClient aws.AWSCloudControlClient
// Connection gets access to the Radius connection which can be used to create API clients.
Connection sdk.Connection
// Workspace gets access to the Radius workspace which can be used to create API clients.
Workspace *workspaces.Workspace
}
func NewRPTestOptions ¶
func NewRPTestOptions(t *testing.T) RPTestOptions
NewRPTestOptions sets up the test environment by loading configs, creating a test context, creating an ApplicationsManagementClient, creating an AWSCloudControlClient, and returning an RPTestOptions struct.
type RequiredFeature ¶
type RequiredFeature string
RequiredFeature is used to specify an optional feature that is required for the test to run.
const ( // FeatureDapr should used with required features to indicate a test dependency // on Dapr. FeatureDapr RequiredFeature = "Dapr" // FeatureCSIDriver should be used with required features to indicate a test dependency // on the CSI driver. FeatureCSIDriver RequiredFeature = "CSIDriver" )
type TestOptions ¶
type TestOptions struct {
test.TestOptions
DiscoveryClient discovery.DiscoveryInterface
}
func NewTestOptions ¶
func NewTestOptions(t *testing.T) TestOptions
NewTestOptions creates a new TestOptions object with the given testing.T object.
type TestStep ¶
type TestStep struct {
Executor step.Executor
RPResources *validation.RPResourceSet
K8sOutputResources []unstructured.Unstructured
K8sObjects *validation.K8sObjectSet
AWSResources *validation.AWSResourceSet
PostStepVerify func(ctx context.Context, t *testing.T, ct RPTest)
SkipKubernetesOutputResourceValidation bool
SkipObjectValidation bool
SkipResourceDeletion bool
}