Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helm-unittest to enchance helm behaviour #4989

Open
ivankatliarchuk opened this issue Jan 3, 2025 · 4 comments
Open

Add helm-unittest to enchance helm behaviour #4989

ivankatliarchuk opened this issue Jan 3, 2025 · 4 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@ivankatliarchuk
Copy link
Contributor

What would you like to be added:

Add helm-unittest as github action to test helm chart

Tool https://github.com/helm-unittest/helm-unittest

I can share more examples

Why is this needed:

  • The helm-unittest plugin allows you to write YAML-based unit tests for Helm charts.
  • Tests can verify that specific values are set correctly in the rendered templates.

There are quite few helm issues, the helm-unittest could help a bit. As having tests will resolve some regression and we could validate behaviour when different values supplied.

@ivankatliarchuk ivankatliarchuk added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 3, 2025
@ivankatliarchuk ivankatliarchuk changed the title Add helm-unittest to add some Add helm-unittest to enchance helm behaviour Jan 3, 2025
@ivankatliarchuk
Copy link
Contributor Author

Hi @stevehipwell. My understanding this is your area. What do you think?

@stevehipwell
Copy link
Contributor

Hi @ivankatliarchuk Helm chart unit tests can add value but I think before adding any we'd want to do a cost/benefit analysis.

IMHO the first thing to look at for improving the quality of a chart is the JSON schema, this should catch the majority of the misconfiguration issues. Once a chart has a full schema then anything not covered by that could be considered a target for a unit test.

@ivankatliarchuk
Copy link
Contributor Author

Ok. Let me know when cost/benefit analysis is conducted. So I open a pr or close this issue))

The Helm JSON schema validates the format and correctness of the values provided to the chart. Helm unit tests go further by verifying the chart's functionality, including the accurate generation of templates based on different sets of values. Sort of different problems.

But yes, having Json Schema will simplify some of the things, and we could have some automated documentation generated as well.

@stevehipwell
Copy link
Contributor

@ivankatliarchuk without a full JSON schema I don't think there is enough benefit to work on this. That said I'm happy for someone to take a real world problem and if it's still an issue after the values are fully covered by a JSON schema, I'd be happy to review unit tests as a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants