Documentation ¶
Index ¶
- Constants
- Variables
- func AstarteDeleteTest(c client.Client, namespace string) error
- func EnsureAstarteBecomesGreen(name, namespace string, c client.Client) (commontypes.AstarteClusterHealth, error)
- func EnsureAstarteServicesReadinessUpTo011(namespace string, c client.Client, checkCFSSL bool) error
- func EnsureAstarteServicesReadinessUpTo10(namespace string, c client.Client) error
- func EnsureDeploymentReadiness(namespace, name string, c client.Client) error
- func EnsureStatefulSetReadiness(namespace, name string, c client.Client) error
- func GetAstarteReconciliationPhase(name, namespace string, c client.Client) (commontypes.ReconciliationPhase, error)
- func GetAstarteStatusVersion(name, namespace string, c client.Client) (string, error)
- func PrintNamespaceEvents(namespace string, c client.Client) error
- func WaitForDeploymentReadiness(namespace, name string, c client.Client) error
- func WaitForStatefulSetReadiness(namespace, name string, c client.Client) error
Constants ¶
const ( // DefaultRetryInterval applied to all tests DefaultRetryInterval time.Duration = time.Second * 10 // DefaultTimeout applied to all tests DefaultTimeout time.Duration = time.Second * 420 // DefaultCleanupRetryInterval applied to all tests DefaultCleanupRetryInterval time.Duration = time.Second * 1 // DefaultCleanupTimeout applied to all tests DefaultCleanupTimeout time.Duration = time.Second * 5 )
Variables ¶
var AstarteTestResource *operator.Astarte = &operator.Astarte{ ObjectMeta: metav1.ObjectMeta{ Name: "example-astarte", }, Spec: commontypes.AstarteSpec{ Version: "0.11.4", DeploymentStrategy: &appsv1.DeploymentStrategy{ Type: appsv1.RecreateDeploymentStrategyType, }, API: commontypes.AstarteAPISpec{ Host: "api.autotest.astarte-platform.org", }, VerneMQ: commontypes.AstarteVerneMQSpec{ Host: "broker.autotest.astarte-platform.org", AstarteGenericClusteredResource: commontypes.AstarteGenericClusteredResource{ Resources: &v1.ResourceRequirements{ Limits: v1.ResourceList{ v1.ResourceCPU: *resource.NewScaledQuantity(0, resource.Milli), v1.ResourceMemory: *resource.NewScaledQuantity(512, resource.Mega), }, Requests: v1.ResourceList{ v1.ResourceCPU: *resource.NewScaledQuantity(0, resource.Milli), v1.ResourceMemory: *resource.NewScaledQuantity(256, resource.Mega), }, }, }, }, RabbitMQ: commontypes.AstarteRabbitMQSpec{ AstarteGenericClusteredResource: commontypes.AstarteGenericClusteredResource{ Resources: &v1.ResourceRequirements{ Limits: v1.ResourceList{ v1.ResourceCPU: *resource.NewScaledQuantity(1000, resource.Milli), v1.ResourceMemory: *resource.NewScaledQuantity(512, resource.Mega), }, Requests: v1.ResourceList{ v1.ResourceCPU: *resource.NewScaledQuantity(200, resource.Milli), v1.ResourceMemory: *resource.NewScaledQuantity(256, resource.Mega), }, }, }, }, Cassandra: commontypes.AstarteCassandraSpec{ MaxHeapSize: "512M", HeapNewSize: "256M", Storage: &commontypes.AstartePersistentStorageSpec{ Size: resource.NewScaledQuantity(10, resource.Giga), }, AstarteGenericClusteredResource: commontypes.AstarteGenericClusteredResource{ Resources: &v1.ResourceRequirements{ Limits: v1.ResourceList{ v1.ResourceCPU: *resource.NewScaledQuantity(1000, resource.Milli), v1.ResourceMemory: *resource.NewScaledQuantity(2048, resource.Mega), }, Requests: v1.ResourceList{ v1.ResourceCPU: *resource.NewScaledQuantity(500, resource.Milli), v1.ResourceMemory: *resource.NewScaledQuantity(1024, resource.Mega), }, }, }, }, CFSSL: commontypes.AstarteCFSSLSpec{ Resources: &v1.ResourceRequirements{ Limits: v1.ResourceList{ v1.ResourceCPU: *resource.NewScaledQuantity(0, resource.Milli), v1.ResourceMemory: *resource.NewScaledQuantity(128, resource.Mega), }, Requests: v1.ResourceList{ v1.ResourceCPU: *resource.NewScaledQuantity(0, resource.Milli), v1.ResourceMemory: *resource.NewScaledQuantity(128, resource.Mega), }, }, Storage: &commontypes.AstartePersistentStorageSpec{ Size: resource.NewScaledQuantity(2, resource.Giga), }, }, Components: commontypes.AstarteComponentsSpec{ Resources: &v1.ResourceRequirements{ Limits: v1.ResourceList{ v1.ResourceCPU: *resource.NewScaledQuantity(0, resource.Milli), v1.ResourceMemory: *resource.NewScaledQuantity(3, resource.Giga), }, Requests: v1.ResourceList{ v1.ResourceCPU: *resource.NewScaledQuantity(0, resource.Milli), v1.ResourceMemory: *resource.NewScaledQuantity(2, resource.Giga), }, }, Flow: commontypes.AstarteGenericAPISpec{ AstarteGenericClusteredResource: commontypes.AstarteGenericClusteredResource{ Deploy: pointy.Bool(true), Image: "astarte/astarte_flow:snapshot", Resources: &v1.ResourceRequirements{ Limits: v1.ResourceList{ v1.ResourceCPU: *resource.NewScaledQuantity(0, resource.Milli), v1.ResourceMemory: *resource.NewScaledQuantity(256, resource.Mega), }, Requests: v1.ResourceList{ v1.ResourceCPU: *resource.NewScaledQuantity(0, resource.Milli), v1.ResourceMemory: *resource.NewScaledQuantity(256, resource.Mega), }, }, }, }, }, }, }
AstarteTestResource is a base common ground for all tests to have a known Astarte resource
Functions ¶
func AstarteDeleteTest ¶ added in v1.0.0
AstarteDeleteTest deletes an Astarte instance and tests whether it was deleted and cleaned up nolint
func EnsureAstarteBecomesGreen ¶ added in v1.0.0
func EnsureAstarteBecomesGreen(name, namespace string, c client.Client) (commontypes.AstarteClusterHealth, error)
func EnsureAstarteServicesReadinessUpTo011 ¶ added in v1.0.0
func EnsureAstarteServicesReadinessUpTo011(namespace string, c client.Client, checkCFSSL bool) error
EnsureAstarteServicesReadinessUpTo011 ensures all existing Astarte components up to 0.11
func EnsureAstarteServicesReadinessUpTo10 ¶ added in v1.0.0
EnsureAstarteServicesReadinessUpTo10 ensures all existing Astarte components up to 1.0
func EnsureDeploymentReadiness ¶
EnsureDeploymentReadiness ensures a Deployment is ready by the time the function is called
func EnsureStatefulSetReadiness ¶
EnsureStatefulSetReadiness ensures a StatefulSet is ready by the time the function is called
func GetAstarteReconciliationPhase ¶ added in v1.0.0
func GetAstarteReconciliationPhase(name, namespace string, c client.Client) (commontypes.ReconciliationPhase, error)
func GetAstarteStatusVersion ¶ added in v1.0.0
func PrintNamespaceEvents ¶
PrintNamespaceEvents prints to fmt all namespace events
func WaitForDeploymentReadiness ¶
WaitForDeploymentReadiness waits until a Deployment is ready with a reasonable timeout
Types ¶
This section is empty.