-
Notifications
You must be signed in to change notification settings - Fork 69
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
Conditional Asserts Enhancement #88
Comments
Hello @stevelipinski, Thanks for the feedback. I noticed there are some options. Suggested solution: As a later enhancement the test can send a warning if a output variabele is set, but not used in other assertions. Do you think it would work? Greetings |
Yeah, I think an output variable would work just as well, and then would there be a when added to the asserts? Essentially working like ansible, right?:
|
I had a similar use-case where I would want certain test cases to throw warnings and their failure would not result in the overall failure of the test suite. This will help add some test cases which are optional to pass. |
@avaakash - FYI, I think mainline work on helm-unittest has moved back to helm-unittest/helm-unittest. You may want to comment there. |
Sure thanks @stevelipinski |
Curious if it would be difficult to add conditional asserts...?
I was investigating using the unittest plugin to come up with a set of tests that validate some helm chart "rules" to be imposed on multiple charts. Thinking along the lines of a compliance audit test suite that ensures all the charts we develop abide by certain rules or best-practices.
To accomplish this, the asserts would need to be conditional, maybe using another assert as the condition.
Just as an example, if I wanted to check that all container images referenced used an internal registry (foo.com), I could create the following asserts:
That is a contrived example, and it could be implemented in a handful of different ways - like instead of referencing the other assert by index, an assert could set some "variables", similar to ansible's
register:
.I wish I was more familiar with Go as I could try to contribute to something like this...
The text was updated successfully, but these errors were encountered: