Helmfile: Add integration with helm-unittest

Created on 9 Mar 2021  路  7Comments  路  Source: roboll/helmfile

At work, we use helm-unittest plugin as part of our CI/CD pipelines.

It would be great if we could integrate the plugin natively into helmfile, e.g

releases:
  - name: release1
    namespace: default
    chart: .test-chart
    values:
      - ./values1.yaml
      - ./values2.yaml
    unit_tests:
       - ./tests

And this would automatically generate the final values file (like helmfile write-values does) and automatically invoke the helm unittest command.

All 7 comments

@renehernandez Good idea!

Just wondering but would you mind if I omitted the unit_tests field?

I think forcing the tests directory path to $CHART/tests and enabling the unittests only for local charts would make that field unneeded. WDYT?

Just wondering but would you mind if I omitted the unit_tests field?

The purpose of having a unit_tests field would be to not force a particular structure to the user. In our case, we are considering having these unit tests next to each helmfile folder instead of on the chart since we are testing the merged output from helmfile instead of the default ones from the chart

Also, is it necessary to differentiate between local and remote charts? I could see the possibility of testing that my values are assigned properly or that certain component is disabled against a remote chart

@mumoshu A new helm-unittest has been published that brings the changes I need in order to work on this integration. I am going to start implementing this next week.

Coming back to your original feedback:

  • Make the unit_tests field optional. I would still like the possibility of allowing for customization of where the tests reside.
  • I am not sure where the default locations for the tests should be. I am more inclined to be in a folder next to the helmfile.yaml file since these tests would be driven by helmfile as opposed to the tests living on the chart folder that I tend to see them as being run by the helm command.

Thoughts?

@renehernandez Hey!

the possibility of allowing for customization of where the tests reside

Makes sense 馃憤

I am not sure where the default locations for the tests should be

Me either, especially after reading your feedback. Can we just begin without the default location and forcing the user to provide the directories containing unittests?

@renehernandez Can we use unittests or unitTests rather than unit_tests? I prefer the latter for consistency but if you find it ugly I think I can go with unittests. To maintain consistency, I've never intended to use anything other than lowerCamelCase in helmfile.yaml

I'll carry on then!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

madAndroid picture madAndroid  路  3Comments

mumoshu picture mumoshu  路  4Comments

RafalMaleska picture RafalMaleska  路  3Comments

michaelpporter picture michaelpporter  路  3Comments

maver1ck picture maver1ck  路  3Comments