Skip to content

Commit

Permalink
feat: tests - workflows updated after switching to official v1 templa…
Browse files Browse the repository at this point in the history
…tes (#5591)

* tests - workflows updated after switching to official v1 templates

* artillery workflows added

* matrix workflows - curl and cypress

* cypress workflow suite updated

* Update test/gradle/executor-smoke/crd-workflow/smoke.yaml

Co-authored-by: Dawid Rusnak <[email protected]>

---------

Co-authored-by: Dawid Rusnak <[email protected]>
  • Loading branch information
tkonieczny and rangoo94 authored Jun 19, 2024
1 parent 0601447 commit e2fc767
Show file tree
Hide file tree
Showing 22 changed files with 412 additions and 119 deletions.
54 changes: 54 additions & 0 deletions test/artillery/executor-smoke/crd/crd-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
name: artillery-workflow-smoke
labels:
core-tests: workflows
spec:
content:
git:
uri: https://github.com/kubeshop/testkube
revision: main
paths:
- test/artillery/executor-smoke/artillery-smoke-test.yaml
container:
resources:
requests:
cpu: 128m
memory: 256Mi
workingDir: /data/repo/test/artillery/executor-smoke
steps:
- name: Run test
run:
image: artilleryio/artillery:2.0.9
args:
- run
- artillery-smoke-test.yaml
---
apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
name: artillery-workflow-smoke-template
labels:
core-tests: workflows
spec:
container:
resources:
requests:
cpu: 128m
memory: 256Mi
workingDir: /data/repo/test/artillery/executor-smoke
steps:
- name: Run from template
content:
git:
uri: https://github.com/kubeshop/testkube
revision: main
paths:
- test/artillery/executor-smoke/artillery-smoke-test.yaml
workingDir: /data/repo/test/artillery/executor-smoke
template:
name: official/artillery/v1
config:
version: 2.0.9
run: "artillery run artillery-smoke-test.yaml"
59 changes: 59 additions & 0 deletions test/curl/executor-tests/crd-workflow/smoke.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
name: curl-workflow-smoke
labels:
core-tests: workflows
spec:
container:
resources:
requests:
cpu: 32m
memory: 32Mi
steps:
- name: Run tests
shell: curl https://testkube.io
container:
image: curlimages/curl:8.7.1
---
apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
name: curl-workflow-smoke-private-registry
labels:
core-tests: workflows
spec:
pod:
imagePullSecrets:
- name: example-private-registry-credentials
container:
resources:
requests:
cpu: 32m
memory: 32Mi
steps:
- name: Run tests
shell: curl https://testkube.io && sleep 10
container:
image: tkoniecznykubeshop/example-private-repo:curl-8.7.1
---
apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
name: curl-workflow-smoke-matrix
labels:
core-tests: workflows
spec:
container:
resources:
requests:
cpu: 32m
memory: 32Mi
steps:
- name: Run tests
parallel:
matrix:
url: ['https://testkube.io', 'https://docs.testkube.io']
shell: curl '{{ matrix.url }}'
container:
image: curlimages/curl:8.7.1
75 changes: 62 additions & 13 deletions test/cypress/executor-tests/crd-workflow/smoke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ spec:
apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
name: cypress-workflow-smoke-13-preofficial-trait
name: cypress-workflow-smoke-13-template
labels:
core-tests: workflows
spec:
Expand All @@ -141,21 +141,21 @@ spec:
paths:
- test/cypress/executor-tests/cypress-13
steps:
- name: Run from trait
- name: Run from template
workingDir: /data/repo/test/cypress/executor-tests/cypress-13
template:
name: pre-official/cypress
name: official/cypress/v1
config:
version: 13.5.0
params: "--env NON_CYPRESS_ENV=NON_CYPRESS_ENV_value --config '{\"screenshotsFolder\":\"/data/artifacts/screenshots\",\"videosFolder\":\"/data/artifacts/videos\"}'"
run: "npx cypress run --env NON_CYPRESS_ENV=NON_CYPRESS_ENV_value --config '{\"screenshotsFolder\":\"/data/artifacts/screenshots\",\"videosFolder\":\"/data/artifacts/videos\"}'"
events:
- cronjob:
cron: "4 */4 * * *"
---
apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
name: cypress-workflow-smoke-13-preofficial-trait-checkout-on-step
name: cypress-workflow-smoke-13-template-checkout-on-step
labels:
core-tests: workflows
spec:
Expand All @@ -169,7 +169,7 @@ spec:
- name: CYPRESS_CUSTOM_ENV # currently only possible on this level
value: "CYPRESS_CUSTOM_ENV_value"
steps:
- name: Run from trait
- name: Run from template
content:
git:
uri: https://github.com/kubeshop/testkube
Expand All @@ -178,18 +178,18 @@ spec:
- test/cypress/executor-tests/cypress-13
workingDir: /data/repo/test/cypress/executor-tests/cypress-13
template:
name: pre-official/cypress
name: official/cypress/v1
config:
version: 13.5.0
params: "--env NON_CYPRESS_ENV=NON_CYPRESS_ENV_value --config '{\"screenshotsFolder\":\"/data/artifacts/screenshots\",\"videosFolder\":\"/data/artifacts/videos\"}'"
run: "npx cypress run --env NON_CYPRESS_ENV=NON_CYPRESS_ENV_value --config '{\"screenshotsFolder\":\"/data/artifacts/screenshots\",\"videosFolder\":\"/data/artifacts/videos\"}'"
events:
- cronjob:
cron: "5 */4 * * *"
---
apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
name: cypress-workflow-smoke-13-preofficial-trait-sub-step
name: cypress-workflow-smoke-13-template-sub-step
labels:
core-tests: workflows
spec:
Expand All @@ -211,13 +211,13 @@ spec:
paths:
- test/cypress/executor-tests/cypress-13
steps:
- name: Run from trait
- name: Run from template
workingDir: /data/repo/test/cypress/executor-tests/cypress-13
template:
name: pre-official/cypress
name: official/cypress/v1
config:
version: 13.5.0
params: "--env NON_CYPRESS_ENV=NON_CYPRESS_ENV_value --config '{\"screenshotsFolder\":\"/data/artifacts/screenshots\",\"videosFolder\":\"/data/artifacts/videos\"}'"
run: "npx cypress run --env NON_CYPRESS_ENV=NON_CYPRESS_ENV_value --config '{\"screenshotsFolder\":\"/data/artifacts/screenshots\",\"videosFolder\":\"/data/artifacts/videos\"}'"
events:
- cronjob:
cron: "6 */4 * * *"
Expand Down Expand Up @@ -357,4 +357,53 @@ spec:
- '**/*'
events:
- cronjob:
cron: "10 */4 * * *"
cron: "10 */4 * * *"
---
apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
name: cypress-workflow-smoke-matrix
labels:
core-tests: workflows
spec:
content:
git:
uri: https://github.com/kubeshop/testkube
revision: main
paths:
- test/cypress/executor-tests/cypress-13
container:
image: cypress/included:13.6.4
workingDir: /data/repo/test/cypress/executor-tests/cypress-13
resources:
requests:
cpu: 1
memory: 1Gi
steps:
- name: Run tests
parallel:
matrix:
browser: ['chrome', 'firefox']
description: '{{ matrix.browser }} browser'
transfer:
- from: /data/repo
run:
args:
- '--browser'
- '{{ matrix.browser }}'
- --env
- NON_CYPRESS_ENV=NON_CYPRESS_ENV_value
- --reporter
- junit
- --reporter-options
- mochaFile=/data/artifacts/junit/junit-[hash].xml,toConsole=false
env:
- name: CYPRESS_CUSTOM_ENV
value: CYPRESS_CUSTOM_ENV_value
artifacts:
workingDir: /data/artifacts
paths:
- '**/*'
events:
- cronjob:
cron: "12 */4 * * *"
31 changes: 30 additions & 1 deletion test/gradle/executor-smoke/crd-workflow/smoke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
name: gradle-workflow-smoke-jdk11-default-command # TODO: recheck if it's fixed - the step passes without being executed
name: gradle-workflow-smoke-jdk11-default-command
labels:
core-tests: workflows
spec:
Expand All @@ -61,3 +61,32 @@ spec:
events:
- cronjob:
cron: "10 */4 * * *"
---
apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
name: gradle-workflow-smoke-jdk11-from-template
labels:
core-tests: workflows
spec:
content:
git:
uri: https://github.com/kubeshop/testkube
revision: main
paths:
- contrib/executor/gradle/examples/hello-gradle
container:
resources:
requests:
cpu: 512m
memory: 512Mi
workingDir: /data/repo/contrib/executor/gradle/examples/hello-gradle
env:
- name: TESTKUBE_GRADLE
value: "true"
steps:
- name: Run from template
template:
name: official/gradle/v1
config:
version: 8.5.0-jdk11
32 changes: 32 additions & 0 deletions test/jmeter/executor-tests/crd-workflow/smoke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,38 @@ spec:
---
apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
name: jmeter-workflow-smoke-from-template
labels:
core-tests: workflows
spec:
content:
git:
uri: https://github.com/kubeshop/testkube
revision: main
paths:
- test/jmeter/executor-tests/jmeter-executor-smoke.jmx
container:
resources:
requests:
cpu: 512m
memory: 512Mi
workingDir: /data/repo/test/jmeter/executor-tests
steps:
- name: Run from template
template:
name: official/jmeter/v1
config:
run: "jmeter -n -t jmeter-executor-smoke.jmx -j /data/artifacts/jmeter.log -o /data/artifacts/report -l /data/artifacts/jtl-report.jtl -e"
steps:
- name: Save artifacts
workingDir: /data/artifacts
artifacts:
paths:
- '**/*'
---
apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
name: distributed-jmeter-workflow-smoke
labels:
Expand Down
16 changes: 8 additions & 8 deletions test/k6/executor-tests/crd-workflow/smoke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
name: k6-workflow-smoke-preofficial-trait
name: k6-workflow-smoke-template
labels:
core-tests: workflows
spec:
Expand All @@ -50,7 +50,7 @@ spec:
- name: K6_SYSTEM_ENV # currently only possible on this level
value: K6_SYSTEM_ENV_value
steps:
- name: Run from trait
- name: Run from template
workingDir: /data/repo/test/k6/executor-tests
content:
git:
Expand All @@ -59,18 +59,18 @@ spec:
paths:
- test/k6/executor-tests/k6-smoke-test.js
template:
name: pre-official/k6
name: official/k6/v1
config:
version: 0.48.0
params: "k6-smoke-test.js -e K6_ENV_FROM_PARAM=K6_ENV_FROM_PARAM_value"
run: "k6 run k6-smoke-test.js -e K6_ENV_FROM_PARAM=K6_ENV_FROM_PARAM_value"
events:
- cronjob:
cron: "12 */4 * * *"
---
apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
name: k6-workflow-smoke-preofficial-trait-without-checkout-step
name: k6-workflow-smoke-template-without-checkout-step
labels:
core-tests: workflows
spec:
Expand All @@ -90,13 +90,13 @@ spec:
- name: K6_SYSTEM_ENV # currently only possible on this level
value: K6_SYSTEM_ENV_value
steps:
- name: Run from trait
- name: Run from template
workingDir: /data/repo/test/k6/executor-tests
template:
name: pre-official/k6
name: official/k6/v1
config:
version: 0.48.0
params: "k6-smoke-test.js -e K6_ENV_FROM_PARAM=K6_ENV_FROM_PARAM_value"
run: "k6 run k6-smoke-test.js -e K6_ENV_FROM_PARAM=K6_ENV_FROM_PARAM_value"
events:
- cronjob:
cron: "12 */4 * * *"
Expand Down
Loading

0 comments on commit e2fc767

Please sign in to comment.