I've created a Helm test but when it succeeds or fails, it only outputs a simple message about whether it succeeded or failed (see below). I would like for it to be able to output custom info about what tests it ran and some info about them. So if it failed, I'd see which things failed specifically. And even if it succeeds, it would show me what things it tested.
NAME: my-app
LAST DEPLOYED: Thu Jan 28 17:45:51 2021
NAMESPACE: default
STATUS: deployed
REVISION: 2
TEST SUITE: my-app-test
Last Started: Thu Jan 28 17:46:05 2021
Last Completed: Thu Jan 28 17:46:06 2021
Phase: Succeeded
I don't see anywhere I can specify this or allow it to add to that output?
As I stated in the comment:
Hello,
$ helm testhas a parameter--logswhere it's description states: "dump the logs from test pods (this runs after all tests are complete, but before any cleanup)".
helm test RELEASE_NAME --logs can be used to produce logs from your scheduled tests:
An example of how $ helm test works could be following:
Helm Chart:
$ helm create raven$ cd raven && helm install raven .$ helm test ravenThe tests for this example Chart are located in the:
ROOT_CHART_DIR/templates/tests/The file that describes a test (test-connection.yaml) looks like below:
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "raven.fullname" . }}-test-connection"
labels:
{{- include "raven.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "raven.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never
This tests could be modified to output the specific messages depending on what the tests actually determined.
The output of the last command should be following:
NAME: raven
<-- OMITTED -->
NOTES:
<-- OMITTED -->
POD LOGS: raven-test-connection
Connecting to raven:80 (10.8.12.208:80)
saving to 'index.html'
index.html 100% |********************************| 612 0:00:00 ETA
'index.html' saved
As it can be seen above the output of wget command with its args was displayed.