From efc86b3a78996bbad89c4e5aa004fbaab57f7fde Mon Sep 17 00:00:00 2001 From: Ricardo Maraschini Date: Wed, 4 May 2022 19:05:22 +0200 Subject: [PATCH] chore: fixed e2e tests 1. Renamed component Base to Quay 2. Split HPA into multiple steps --- e2e/hpa/00-assert.yaml | 7 +- e2e/hpa/01-assert.yaml | 27 +---- e2e/hpa/01-unmanage-hpa.yaml | 21 ---- e2e/hpa/02-assert.yaml | 102 +--------------- e2e/hpa/02-bump-hpas.yaml | 21 ++++ e2e/hpa/03-assert.yaml | 110 ++++++++++++++++++ ...{02-manage-hpa.yaml => 03-manage-hpa.yaml} | 0 7 files changed, 139 insertions(+), 149 deletions(-) create mode 100644 e2e/hpa/02-bump-hpas.yaml create mode 100644 e2e/hpa/03-assert.yaml rename e2e/hpa/{02-manage-hpa.yaml => 03-manage-hpa.yaml} (100%) diff --git a/e2e/hpa/00-assert.yaml b/e2e/hpa/00-assert.yaml index d771f9f89..5e7e7c16d 100644 --- a/e2e/hpa/00-assert.yaml +++ b/e2e/hpa/00-assert.yaml @@ -69,7 +69,7 @@ status: - message: Quay component healthy reason: ComponentReady status: "True" - type: ComponentBaseReady + type: ComponentQuayReady - message: Deployment hpa-quay-mirror healthy reason: ComponentReady status: "True" @@ -86,8 +86,3 @@ status: reason: ComponentsCreationSuccess status: "False" type: RolloutBlocked ---- -apiVersion: kuttl.dev/v1beta1 -kind: TestAssert -timeout: 1000 ---- \ No newline at end of file diff --git a/e2e/hpa/01-assert.yaml b/e2e/hpa/01-assert.yaml index 1938bead0..7e014af2f 100644 --- a/e2e/hpa/01-assert.yaml +++ b/e2e/hpa/01-assert.yaml @@ -70,7 +70,7 @@ status: - message: Quay component healthy reason: ComponentReady status: "True" - type: ComponentBaseReady + type: ComponentQuayReady - message: Deployment hpa-quay-mirror healthy reason: ComponentReady status: "True" @@ -87,28 +87,3 @@ status: reason: ComponentsCreationSuccess status: "False" type: RolloutBlocked ---- -apiVersion: autoscaling/v1 -kind: HorizontalPodAutoscaler -metadata: - name: hpa-clair-app -status: - currentReplicas: 3 - desiredReplicas: 3 ---- -apiVersion: autoscaling/v1 -kind: HorizontalPodAutoscaler -metadata: - name: hpa-quay-app -status: - currentReplicas: 3 - desiredReplicas: 3 ---- -apiVersion: autoscaling/v1 -kind: HorizontalPodAutoscaler -metadata: - name: hpa-quay-mirror -status: - currentReplicas: 3 - desiredReplicas: 3 ---- \ No newline at end of file diff --git a/e2e/hpa/01-unmanage-hpa.yaml b/e2e/hpa/01-unmanage-hpa.yaml index abbae1305..885688ae3 100644 --- a/e2e/hpa/01-unmanage-hpa.yaml +++ b/e2e/hpa/01-unmanage-hpa.yaml @@ -27,24 +27,3 @@ spec: managed: true - kind: tls managed: true ---- -apiVersion: autoscaling/v1 -kind: HorizontalPodAutoscaler -metadata: - name: hpa-clair-app -spec: - minReplicas: 3 ---- -apiVersion: autoscaling/v1 -kind: HorizontalPodAutoscaler -metadata: - name: hpa-quay-app -spec: - minReplicas: 3 ---- -apiVersion: autoscaling/v1 -kind: HorizontalPodAutoscaler -metadata: - name: hpa-quay-mirror -spec: - minReplicas: 3 \ No newline at end of file diff --git a/e2e/hpa/02-assert.yaml b/e2e/hpa/02-assert.yaml index 5ccd634cf..a67b76d30 100644 --- a/e2e/hpa/02-assert.yaml +++ b/e2e/hpa/02-assert.yaml @@ -1,114 +1,24 @@ --- -apiVersion: quay.redhat.com/v1 -kind: QuayRegistry -metadata: - finalizers: - - quay-operator/finalizer - name: hpa -spec: - components: - - kind: clair - managed: true - - kind: clairpostgres - managed: true - - kind: quay - managed: true - - kind: postgres - managed: true - - kind: redis - managed: true - - kind: horizontalpodautoscaler - managed: true - - kind: objectstorage - managed: true - - kind: route - managed: true - - kind: mirror - managed: true - - kind: monitoring - managed: true - - kind: tls - managed: true -status: - conditions: - - message: Horizontal pod autoscaler found - reason: ComponentReady - status: "True" - type: ComponentHPAReady - - message: Route admitted - reason: ComponentReady - status: "True" - type: ComponentRouteReady - - message: ServiceMonitor and PrometheusRules created - reason: ComponentReady - status: "True" - type: ComponentMonitoringReady - - message: Deployment hpa-quay-database healthy - reason: ComponentReady - status: "True" - type: ComponentPostgresReady - - message: Object bucket claim bound - reason: ComponentReady - status: "True" - type: ComponentObjectStorageReady - - message: Clair component healthy - reason: ComponentReady - status: "True" - type: ComponentClairReady - - message: ClairPostgres component healthy - reason: ComponentReady - status: "True" - type: ComponentClairPostgresReady - - message: Using cluster wildcard certs - reason: ComponentReady - status: "True" - type: ComponentTLSReady - - message: Deployment hpa-quay-redis healthy - reason: ComponentReady - status: "True" - type: ComponentRedisReady - - message: Quay component healthy - reason: ComponentReady - status: "True" - type: ComponentBaseReady - - message: Deployment hpa-quay-mirror healthy - reason: ComponentReady - status: "True" - type: ComponentMirrorReady - - message: All components reporting as healthy - reason: HealthChecksPassing - status: "True" - type: Available - - message: All registry components created - reason: ComponentsCreationSuccess - status: "True" - type: ComponentsCreated - - message: All objects created/updated successfully - reason: ComponentsCreationSuccess - status: "False" - type: RolloutBlocked ---- apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler metadata: name: hpa-clair-app status: - currentReplicas: 2 - desiredReplicas: 2 + currentReplicas: 3 + desiredReplicas: 3 --- apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler metadata: name: hpa-quay-app status: - currentReplicas: 2 - desiredReplicas: 2 + currentReplicas: 3 + desiredReplicas: 3 --- apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler metadata: name: hpa-quay-mirror status: - currentReplicas: 2 - desiredReplicas: 2 ---- \ No newline at end of file + currentReplicas: 3 + desiredReplicas: 3 diff --git a/e2e/hpa/02-bump-hpas.yaml b/e2e/hpa/02-bump-hpas.yaml new file mode 100644 index 000000000..04270ef16 --- /dev/null +++ b/e2e/hpa/02-bump-hpas.yaml @@ -0,0 +1,21 @@ +--- +apiVersion: autoscaling/v1 +kind: HorizontalPodAutoscaler +metadata: + name: hpa-clair-app +spec: + minReplicas: 3 +--- +apiVersion: autoscaling/v1 +kind: HorizontalPodAutoscaler +metadata: + name: hpa-quay-app +spec: + minReplicas: 3 +--- +apiVersion: autoscaling/v1 +kind: HorizontalPodAutoscaler +metadata: + name: hpa-quay-mirror +spec: + minReplicas: 3 diff --git a/e2e/hpa/03-assert.yaml b/e2e/hpa/03-assert.yaml new file mode 100644 index 000000000..8fcb5b876 --- /dev/null +++ b/e2e/hpa/03-assert.yaml @@ -0,0 +1,110 @@ +--- +apiVersion: quay.redhat.com/v1 +kind: QuayRegistry +metadata: + finalizers: + - quay-operator/finalizer + name: hpa +spec: + components: + - kind: clair + managed: true + - kind: clairpostgres + managed: true + - kind: quay + managed: true + - kind: postgres + managed: true + - kind: redis + managed: true + - kind: horizontalpodautoscaler + managed: true + - kind: objectstorage + managed: true + - kind: route + managed: true + - kind: mirror + managed: true + - kind: monitoring + managed: true + - kind: tls + managed: true +status: + conditions: + - message: Horizontal pod autoscaler found + reason: ComponentReady + status: "True" + type: ComponentHPAReady + - message: Route admitted + reason: ComponentReady + status: "True" + type: ComponentRouteReady + - message: ServiceMonitor and PrometheusRules created + reason: ComponentReady + status: "True" + type: ComponentMonitoringReady + - message: Deployment hpa-quay-database healthy + reason: ComponentReady + status: "True" + type: ComponentPostgresReady + - message: Object bucket claim bound + reason: ComponentReady + status: "True" + type: ComponentObjectStorageReady + - message: Clair component healthy + reason: ComponentReady + status: "True" + type: ComponentClairReady + - message: ClairPostgres component healthy + reason: ComponentReady + status: "True" + type: ComponentClairPostgresReady + - message: Using cluster wildcard certs + reason: ComponentReady + status: "True" + type: ComponentTLSReady + - message: Deployment hpa-quay-redis healthy + reason: ComponentReady + status: "True" + type: ComponentRedisReady + - message: Quay component healthy + reason: ComponentReady + status: "True" + type: ComponentQuayReady + - message: Deployment hpa-quay-mirror healthy + reason: ComponentReady + status: "True" + type: ComponentMirrorReady + - message: All components reporting as healthy + reason: HealthChecksPassing + status: "True" + type: Available + - message: All registry components created + reason: ComponentsCreationSuccess + status: "True" + type: ComponentsCreated + - message: All objects created/updated successfully + reason: ComponentsCreationSuccess + status: "False" + type: RolloutBlocked +--- +apiVersion: autoscaling/v1 +kind: HorizontalPodAutoscaler +metadata: + name: hpa-clair-app +spec: + minReplicas: 2 +--- +apiVersion: autoscaling/v1 +kind: HorizontalPodAutoscaler +metadata: + name: hpa-quay-app +spec: + minReplicas: 2 +--- +apiVersion: autoscaling/v1 +kind: HorizontalPodAutoscaler +metadata: + name: hpa-quay-mirror +spec: + minReplicas: 2 diff --git a/e2e/hpa/02-manage-hpa.yaml b/e2e/hpa/03-manage-hpa.yaml similarity index 100% rename from e2e/hpa/02-manage-hpa.yaml rename to e2e/hpa/03-manage-hpa.yaml