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
Feat/add snapshot based testing for helm #1378
Feat/add snapshot based testing for helm #1378
Conversation
|
@denis256: I resolved the conflict, could you please review it? |
….com/jguionnet/terratest into feat/snapshsot-testing-for-helm
@denis256. Thanks for reviewing. I fixed it according to the feedback. |
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.
Proposed functions don't follow existing patterns:
- no
*E
function which check for errors t testing.TestingT
not passed
Go mod don't have all changes commited
$ git status
On branch feat/add-remote-repo-support-in-helm
nothing to commit, working tree clean
$ go mod tidy
$ git status
On branch feat/add-remote-repo-support-in-helm
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: go.mod
modules/helm/template.go
Outdated
|
||
reportWriter.WriteReport(os.Stdout) | ||
|
||
// return the number of diffs to use in in assertion while testing: 0 = no differences |
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.
in
Added an option for snaphsot directory go mod tidy
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.
Approach looks fine, some wording updates and comments on functions should be updated
@denis256. Thank you for your thorough review and for catching all my mistakes. I fixed it according to your latest feedback. |
Description
Fixes #1377
Add a set of helper functions, like the
UnmarshalK8SYaml
functions.UpdateSnapshot
creates/refreshes a local snapshotDiffAgainstSnapshot
diffs the manifest generated by the test against the local snapshot. It returns the number of differences that can be asserted in a test. It also displays the difference between the two sets of k8s manifests in git style.See test output in this gist https://gist.github.com/jguionnet/376e768009a244d3315f31b82598aa78
TODOs
Read the Gruntwork contribution guidelines.
Release Notes (draft)
Added / Removed / Updated [X].
Added support in Helm for snapshot testing, similar to helm-unittest feature snapshot testing.
Migration Guide
NA