Add unit tests for env, envFrom, st2.packs.images, and st2.packs.volumes by cognifloyd · Pull Request #292 · StackStorm/stackstorm-k8s

@cognifloyd

  • add tests for env and envFrom
  • test deployments and jobs with/out st2.packs.images and without st2.packs.volumes
  • test deployments and jobs with/out st2.packs.images and with st2.packs.volumes
  • test misconfigured st2.packs.volumes

@cognifloyd

@cognifloyd

cognifloyd

Comment on lines +1967 to +1969

{{- else }}
volumeMounts: []
volumes: []

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This simplified a chunk of the (already lengthy) volume tests.

@cognifloyd

@cognifloyd

cognifloyd

{{- end }}
{{- if $sensor.env }}
env: {{- include "stackstorm-ha.customEnv" . | nindent 8 }}
env: {{- include "stackstorm-ha.customEnv" $sensor | nindent 8 }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The env test caught this typo

cognifloyd

@cognifloyd

@cognifloyd

@cognifloyd

@armab could you review this? It may be large, but that's because the unit tests are very repetitive to cover the various possibilities (helm-unittest doesn't have anything like pytest's parametrize).

arm4b

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@cognifloyd

@cognifloyd

Thanks for reviewing! I know this was pretty large.