Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

212
Visualizações
How add output detail into test output from a Helm test?

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?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

As I stated in the comment:

Hello, $ helm test has a parameter --logs where 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:

  • Helm.sh: Docs: Topic: Chart test

An example of how $ helm test works could be following:

  • Create an example Helm Chart:
    • $ helm create raven
  • Go into directory and install the Chart:
    • $ cd raven && helm install raven .
  • After the Chart is deployed run:
    • $ helm test raven

The 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.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda