From 87a42c145604713db46b776b0804034d52eab25b Mon Sep 17 00:00:00 2001 From: Tomasz Konieczny Date: Wed, 26 Feb 2025 14:52:06 +0100 Subject: [PATCH] feat: core tests - Artillery distributed workflow (#6201) * cypress revision fixed * core tests - artillery distributed workflow * artillery workflow suite extended with distributed example * small suite extended with cypress workflow * workflow example namespace removed --- .../executor-smoke/crd-workflow/smoke.yaml | 64 +++++++++++++++++-- .../executor-tests/crd-workflow/smoke.yaml | 4 +- .../test-workflows/artillery-workflow.yaml | 1 + test/suites/test-workflows/small-smoke.yaml | 1 + 4 files changed, 62 insertions(+), 8 deletions(-) diff --git a/test/artillery/executor-smoke/crd-workflow/smoke.yaml b/test/artillery/executor-smoke/crd-workflow/smoke.yaml index e5cb2e8c2f9..c2418a9c086 100644 --- a/test/artillery/executor-smoke/crd-workflow/smoke.yaml +++ b/test/artillery/executor-smoke/crd-workflow/smoke.yaml @@ -17,13 +17,10 @@ spec: cpu: 128m memory: 256Mi workingDir: /data/repo/test/artillery/executor-smoke + image: artilleryio/artillery:2.0.22 steps: - name: Run test - run: - image: artilleryio/artillery:2.0.9 - args: - - run - - artillery-smoke-test.yaml + shell: /home/node/artillery/bin/run run artillery-smoke-test.yaml --- apiVersion: testworkflows.testkube.io/v1 kind: TestWorkflow @@ -50,5 +47,60 @@ spec: template: name: official/artillery/v1 config: - version: 2.0.9 + version: 2.0.22 run: "artillery run artillery-smoke-test.yaml" +--- +kind: TestWorkflow +apiVersion: testworkflows.testkube.io/v1 +metadata: + name: distributed-artillery-workflow-smoke-artifacts + labels: + core-tests: workflows +spec: + config: + arrivalRatePerWorker: + type: integer + default: 2 + duration: + type: string + default: 2 + workers: + type: integer + default: 2 + content: + git: + uri: https://github.com/kubeshop/testkube + revision: main + paths: + - test/artillery/executor-smoke/artillery-smoke-test.yaml + container: + image: artilleryio/artillery:2.0.20 + steps: + - name: Run test + parallel: + count: config.workers + transfer: + - from: /data/repo + fetch: + - from: /data/artifacts + use: + - name: distribute/evenly + container: + image: artilleryio/artillery:2.0.20 + resources: + requests: + cpu: 128m + memory: 256Mi + paused: true + run: + workingDir: /data/repo/test/artillery/executor-smoke + shell: "mkdir -p /data/artifacts && /home/node/artillery/bin/run run artillery-smoke-test.yaml --overrides '{ \"phases\": [{ \"duration\": {{ config.duration }}, \"arrivalRate\": {{ config.arrivalRatePerWorker }} }] }' -o /data/artifacts/report-{{ index }}.json" + - name: Generate HTML report # The "report" command is deprecated and will be removed in a future release of Artillery. + shell: mkdir html && for file in *.json; do /home/node/artillery/bin/run report "$file" -o "html/${file%.json}.html"; done + workingDir: /data/artifacts + - name: Save artifacts + condition: always + artifacts: + workingDir: /data/artifacts + paths: + - '**/*' diff --git a/test/cypress/executor-tests/crd-workflow/smoke.yaml b/test/cypress/executor-tests/crd-workflow/smoke.yaml index 06d9afe9f27..b093f9e1d12 100644 --- a/test/cypress/executor-tests/crd-workflow/smoke.yaml +++ b/test/cypress/executor-tests/crd-workflow/smoke.yaml @@ -8,7 +8,7 @@ spec: content: git: uri: https://github.com/kubeshop/testkube - revision: cypress-14-project-and-cleanup # TODO: update before merge + revision: main paths: - test/cypress/executor-tests/cypress-14 container: @@ -46,7 +46,7 @@ spec: content: git: uri: https://github.com/kubeshop/testkube - revision: cypress-14-project-and-cleanup # TODO: update before merge + revision: main paths: - test/cypress/executor-tests/cypress-14 container: diff --git a/test/suites/test-workflows/artillery-workflow.yaml b/test/suites/test-workflows/artillery-workflow.yaml index b9790dd5881..ef967fdf985 100644 --- a/test/suites/test-workflows/artillery-workflow.yaml +++ b/test/suites/test-workflows/artillery-workflow.yaml @@ -11,3 +11,4 @@ spec: workflows: - name: artillery-workflow-smoke - name: artillery-workflow-smoke-template + - name: distributed-artillery-workflow-smoke-artifacts diff --git a/test/suites/test-workflows/small-smoke.yaml b/test/suites/test-workflows/small-smoke.yaml index 81312891e6e..ab867b6f42b 100644 --- a/test/suites/test-workflows/small-smoke.yaml +++ b/test/suites/test-workflows/small-smoke.yaml @@ -16,3 +16,4 @@ spec: - name: postman-workflow-smoke-template - name: soapui-workflow-smoke - name: pytest-workflow-smoke-junit-success-only + - name: cypress-workflow-smoke-14