-
Notifications
You must be signed in to change notification settings - Fork 928
chore(helm): add unit tests for helm chart #6557
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
Conversation
Excited for this! |
You should try a nested go.mod file so any packages that import coder don't suffer. |
helm/tests/values_test.go
Outdated
} | ||
|
||
// Values is the top-level values struct for the Coder chart. | ||
type Values struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of having to maintain this type like we did in v1 (and forgot to do many times) can we just use map[string]any
as the values type for test cases instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decided to go one level further and just run helm template
instead; it's conceptually much simpler and removes the extra k8s API deps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
This PR adds a minimum set of Helm tests for the Helm chart.
It's heavily based on the approach in enterprise-helm, but uses a golden-files-based approach instead.
It also runs
helm template
directly instead of importing the entire Kubernetes API.Golden files can be updated by running
go test ./helm/tests -update
or by runningmake update-golden-files
.Fixes #6552