roboll / helmfile

Deploy Kubernetes Helm Charts
MIT License
4.05k stars 564 forks source link

Add integration with helm-unittest #1713

Open renehernandez opened 3 years ago

renehernandez commented 3 years ago

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.

mumoshu commented 3 years ago

@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?

renehernandez commented 3 years ago

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

renehernandez commented 3 years ago

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

renehernandez commented 3 years ago

@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:

Thoughts?

mumoshu commented 3 years ago

@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?

mumoshu commented 3 years ago

@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

renehernandez commented 3 years ago

I'll carry on then!

mathe-matician commented 7 months ago

@mumoshu any thoughts on integrating this still?

yxxhero commented 7 months ago

@mathe-matician could you create an new issue at helmfile/helmfile repo? thanks so much.

mathe-matician commented 7 months ago

@yxxhero my mistake - I didn't realize I was on the old repo. Will do!