From 1f00e336bf45af53ed2cf951467256680555eef3 Mon Sep 17 00:00:00 2001 From: Mohamed Osman Date: Tue, 28 Feb 2023 12:47:40 -0500 Subject: [PATCH] simplify e2e --- tests/e2e/autoscale/00-install.yaml | 6 ++++-- tests/e2e/autoscale/03-assert.yaml | 9 --------- tests/e2e/autoscale/03-install.yaml | 22 ---------------------- tests/e2e/autoscale/04-delete.yaml | 2 +- tests/e2e/autoscale/05-assert.yaml | 7 +++++++ tests/e2e/autoscale/05-delete.yaml | 8 -------- tests/e2e/autoscale/06-assert.yaml | 16 ---------------- 7 files changed, 12 insertions(+), 58 deletions(-) create mode 100644 tests/e2e/autoscale/05-assert.yaml delete mode 100644 tests/e2e/autoscale/05-delete.yaml delete mode 100644 tests/e2e/autoscale/06-assert.yaml diff --git a/tests/e2e/autoscale/00-install.yaml b/tests/e2e/autoscale/00-install.yaml index 8a00255e0c..2b584163fb 100644 --- a/tests/e2e/autoscale/00-install.yaml +++ b/tests/e2e/autoscale/00-install.yaml @@ -1,6 +1,8 @@ # This creates two different deployments: -# * The first one will be used to see if we scale properly -# * The second is to check the targetCPUUtilization option +# * The first one is to ensure an autoscaler is created without +# setting any metrics in the Spec. +# * The second is to check that scaling works properly and that +# spec updates are working as expected. # apiVersion: opentelemetry.io/v1alpha1 kind: OpenTelemetryCollector diff --git a/tests/e2e/autoscale/03-assert.yaml b/tests/e2e/autoscale/03-assert.yaml index 8a56ead8b5..8dc83f76b8 100644 --- a/tests/e2e/autoscale/03-assert.yaml +++ b/tests/e2e/autoscale/03-assert.yaml @@ -1,12 +1,3 @@ -# Wait until tracegen has completed and the simplest deployment has scaled up to 2 -apiVersion: opentelemetry.io/v1alpha1 -kind: OpenTelemetryCollector -metadata: - name: simplest -status: - scale: - replicas: 2 ---- apiVersion: opentelemetry.io/v1alpha1 kind: OpenTelemetryCollector metadata: diff --git a/tests/e2e/autoscale/03-install.yaml b/tests/e2e/autoscale/03-install.yaml index 104a2bb7ef..0c2ee6249a 100644 --- a/tests/e2e/autoscale/03-install.yaml +++ b/tests/e2e/autoscale/03-install.yaml @@ -1,27 +1,5 @@ apiVersion: batch/v1 kind: Job -metadata: - name: tracegen -spec: - template: - spec: - containers: - - name: tracegen - image: ghcr.io/open-telemetry/opentelemetry-collector-contrib/tracegen:latest - command: - - "./tracegen" - args: - - -otlp-endpoint=simplest-collector-headless:4317 - - -otlp-insecure - # High duration to ensure the trace creation doesn't stop. - # It'll be stopped in step 4 - - -duration=1m - - -workers=20 - restartPolicy: Never - backoffLimit: 4 ---- -apiVersion: batch/v1 -kind: Job metadata: name: tracegen-set-utilization spec: diff --git a/tests/e2e/autoscale/04-delete.yaml b/tests/e2e/autoscale/04-delete.yaml index 9502a9e4e5..2e7041267b 100644 --- a/tests/e2e/autoscale/04-delete.yaml +++ b/tests/e2e/autoscale/04-delete.yaml @@ -5,4 +5,4 @@ delete: kind: Job propagationPolicy: Background metadata: - name: tracegen \ No newline at end of file + name: tracegen-set-utilization \ No newline at end of file diff --git a/tests/e2e/autoscale/05-assert.yaml b/tests/e2e/autoscale/05-assert.yaml new file mode 100644 index 0000000000..dac0c9e105 --- /dev/null +++ b/tests/e2e/autoscale/05-assert.yaml @@ -0,0 +1,7 @@ +apiVersion: opentelemetry.io/v1alpha1 +kind: OpenTelemetryCollector +metadata: + name: simplest-set-utilization +status: + scale: + replicas: 1 \ No newline at end of file diff --git a/tests/e2e/autoscale/05-delete.yaml b/tests/e2e/autoscale/05-delete.yaml deleted file mode 100644 index 2e7041267b..0000000000 --- a/tests/e2e/autoscale/05-delete.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -delete: -- apiVersion: batch/v1 - kind: Job - propagationPolicy: Background - metadata: - name: tracegen-set-utilization \ No newline at end of file diff --git a/tests/e2e/autoscale/06-assert.yaml b/tests/e2e/autoscale/06-assert.yaml deleted file mode 100644 index 4743f5f51d..0000000000 --- a/tests/e2e/autoscale/06-assert.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# Wait for the collector to scale back down to 1 -apiVersion: opentelemetry.io/v1alpha1 -kind: OpenTelemetryCollector -metadata: - name: simplest -status: - scale: - replicas: 1 ---- -apiVersion: opentelemetry.io/v1alpha1 -kind: OpenTelemetryCollector -metadata: - name: simplest-set-utilization -status: - scale: - replicas: 1 \ No newline at end of file