Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload kuttl-report.xml regardless of failure #309

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions taskfiles/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tasks:

run-kuttl-tests:
cmds:
- defer: 'task ci:kuttl-artifact-upload EXIT_CODE={{.EXIT_CODE}} KUTTL_CONFIG_FILE={{.KUTTL_CONFIG_FILE}}'
- defer: 'task ci:kuttl-artifact-upload KUTTL_CONFIG_FILE={{.KUTTL_CONFIG_FILE}}'
- task: :k8s:run-kuttl-tests
vars:
KUTTL_CONFIG_FILE: '{{.KUTTL_CONFIG_FILE}}'
Expand All @@ -24,7 +24,7 @@ tasks:
desc: uploads artifact when kuttl fails
dir: operator
summary: |
kuttl-artifact-upload should be called in `defer` with EXIT_CODE.
kuttl-artifact-upload should be called in `defer`.
https://taskfile.dev/usage/#doing-task-cleanup-with-defer

As buildkite pipeline step are wrapped with shell script, that executes
Expand All @@ -38,12 +38,9 @@ tasks:
sh: |
cat {{.KUTTL_CONFIG_FILE}} | grep artifactsDir | awk '{print $2}'
cmds:
- echo "Kuttl returned exit code {{.EXIT_CODE}}. Creating artifacts tarball"
- tar -czf {{.KUTTL_ARTIFACTS_DIR | base}}.tar.gz {{.KUTTL_ARTIFACTS_DIR}}
- buildkite-agent artifact upload "{{.SRC_DIR}}/operator/{{.KUTTL_ARTIFACTS_DIR | base}}.tar.gz"
- buildkite-agent artifact upload "{{.SRC_DIR}}/operator/{{.KUTTL_ARTIFACTS_DIR}}/kuttl-report.xml"
status:
- exit {{.EXIT_CODE}}

k8s:
cmds:
Expand Down