-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Example workflows - playwright examples simplified, expected-fa…
…il - timeout examples (#6078) * workflow example: expected-fail-timeout * playwright workflows simplified - shell instead of cmd/args * expected fail - timeout examples - activeDeadlineSeconds and Step timeout, playwright example fixed * expected-fail-k6-test-report-condition-always-no-artifacts updated * expected-fail-timeout-step updated
- Loading branch information
1 parent
6af5236
commit 31d5a7b
Showing
3 changed files
with
88 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,28 +12,17 @@ spec: | |
paths: | ||
- test/playwright/executor-tests/playwright-project | ||
container: | ||
image: mcr.microsoft.com/playwright:v1.32.3-focal | ||
resources: | ||
requests: | ||
cpu: 2 | ||
memory: 2Gi | ||
workingDir: /data/repo/test/playwright/executor-tests/playwright-project | ||
steps: | ||
- name: Install dependencies | ||
run: | ||
image: mcr.microsoft.com/playwright:v1.32.3-focal | ||
command: | ||
- npm | ||
args: | ||
- ci | ||
shell: "npm ci" | ||
- name: Run tests | ||
run: | ||
image: mcr.microsoft.com/playwright:v1.32.3-focal | ||
command: | ||
- "npx" | ||
args: | ||
- "--yes" | ||
- "[email protected]" | ||
- "test" | ||
shell: "npx playwright test" | ||
- name: Save artifacts | ||
workingDir: /data/repo/test/playwright/executor-tests/playwright-project | ||
artifacts: | ||
|
@@ -61,23 +50,10 @@ spec: | |
workingDir: /data/repo/test/playwright/executor-tests/playwright-project | ||
steps: | ||
- name: Install dependencies | ||
run: | ||
image: mcr.microsoft.com/playwright:v1.32.3-focal | ||
command: | ||
- npm | ||
args: | ||
- ci | ||
shell: "npm ci" | ||
- name: Run tests | ||
run: | ||
image: mcr.microsoft.com/playwright:v1.32.3-focal | ||
command: | ||
- "npx" | ||
args: | ||
- "--yes" | ||
- "[email protected]" | ||
- "test" | ||
- "--output" | ||
- "/data/artifacts" | ||
shell: "npx playwright test --output /data/artifacts" | ||
env: | ||
- name: PLAYWRIGHT_HTML_REPORT | ||
value: /data/artifacts/playwright-report | ||
|
@@ -91,7 +67,7 @@ spec: | |
apiVersion: testworkflows.testkube.io/v1 | ||
kind: TestWorkflow | ||
metadata: | ||
name: playwright-workflow-smoke-v1.32.3-shell | ||
name: playwright-workflow-smoke-v1.32.3-command-args | ||
labels: | ||
core-tests: workflows | ||
spec: | ||
|
@@ -110,15 +86,22 @@ spec: | |
steps: | ||
- name: Install dependencies | ||
run: | ||
image: mcr.microsoft.com/playwright:v1.32.3-focal | ||
image: mcr.microsoft.com/playwright:v1.32.3-focal # image on step level | ||
command: | ||
- npm | ||
args: | ||
- ci | ||
- name: Run tests | ||
shell: "npx --yes [email protected] test --output /data/artifacts && cd /data/artifacts && ls -lah" | ||
container: | ||
run: | ||
image: mcr.microsoft.com/playwright:v1.32.3-focal | ||
command: | ||
- "npx" | ||
args: | ||
- "--yes" | ||
- "[email protected]" | ||
- "test" | ||
- "--output" | ||
- "/data/artifacts" | ||
env: | ||
- name: PLAYWRIGHT_HTML_REPORT | ||
value: /data/artifacts/playwright-report | ||
|
@@ -129,7 +112,6 @@ spec: | |
paths: | ||
- '**/*' | ||
--- | ||
--- | ||
apiVersion: testworkflows.testkube.io/v1 | ||
kind: TestWorkflow | ||
metadata: | ||
|
@@ -176,6 +158,7 @@ spec: | |
paths: | ||
- test/playwright/executor-tests/playwright-project | ||
container: | ||
image: mcr.microsoft.com/playwright:v1.32.3-focal | ||
resources: | ||
requests: | ||
cpu: 2 | ||
|
@@ -184,14 +167,12 @@ spec: | |
steps: | ||
- name: Install dependencies | ||
run: | ||
image: mcr.microsoft.com/playwright:v1.32.3-focal | ||
command: | ||
- npm | ||
args: | ||
- ci | ||
- name: Run tests | ||
run: | ||
image: mcr.microsoft.com/playwright:v1.32.3-focal | ||
command: | ||
- "npx" | ||
args: | ||
|
@@ -249,7 +230,6 @@ spec: | |
workingDir: /data/repo/test/playwright/executor-tests/playwright-project | ||
steps: | ||
- name: Install dependencies | ||
# TODO: Upgrade our Playwright tests to use newer version; Blob reporter was not available in 1.32.3 | ||
shell: 'npm install --save-dev @playwright/[email protected] && npm ci' | ||
- name: Run tests | ||
parallel: | ||
|
@@ -264,7 +244,7 @@ spec: | |
- name: Merge reports | ||
condition: always | ||
shell: 'npx playwright merge-reports --reporter=html /data/reports' | ||
artifacts: | ||
artifacts: # artifacts with fetch from parallel steps | ||
paths: | ||
- "playwright-report/**" | ||
--- | ||
|
@@ -286,7 +266,6 @@ spec: | |
workingDir: /data/repo/test/playwright/executor-tests/playwright-project | ||
steps: | ||
- name: Install dependencies | ||
# TODO: Upgrade our Playwright tests to use newer version; Blob reporter was not available in 1.32.3 | ||
shell: 'npm install --save-dev @playwright/[email protected] && npm ci' | ||
- name: Run tests | ||
parallel: | ||
|
@@ -295,7 +274,7 @@ spec: | |
- from: /data/repo | ||
run: | ||
shell: 'mkdir /data/artifacts && npx playwright test --reporter=junit --shard {{ index + 1 }}/{{ count }} > /data/artifacts/junit-report{{ index + 1 }}.xml' | ||
artifacts: | ||
artifacts: # artifacts directly on parallel step | ||
workingDir: /data/artifacts/ | ||
paths: | ||
- '**/*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters