-
Notifications
You must be signed in to change notification settings - Fork 69
Unittests with helm3 cause unwanted side effects #111
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
Comments
Hello @armingerten, Thanks for the feedback. The implementation indeed should behave, as each test has immutable values. I will look into this and try to fix it. Greetings, |
Hello @armingerten, I have verified some scenario's and with all the current testcases i'm not able to reproduce your situation. Perhaps you can help me with some examples, so i can understand the situation better. Also here is some additional pointers on how the rendering of the tests are setup and the immutability of the values files, this may help understanding how the unittests work:
Greetings, |
Hi @quintush, thanks for the quick reply! I was also having trouble narrowing down the exact root cause for this issue. I renamed and stripped down my chart as much as possible until I ended up with this minimal setup to reproduce the issue. When running
There is a couple of observations I made when testing, and now I am completely puzzled:
|
Did you have any luck reproducing the issue? My best guess is that it might be related to using values within |
Hello @armingerten, It took some time to investigate the actual situation.
1 There was an issue that importing data in sub-subcharts got corrupted (#115). This problem could relate to your first observation.
Currently i'm not able to validate the versioning of all dependencies, but i did create some additional samples to have more support on this particular situation. Greetings, |
just wanted to share that on my side with quite complex helm v3 charts I encountered the same issue with states overlapping to other tests. Using the code of @armingerten 's PR and compiling the plugin again fixed my issue. I am using helm v3.7.0. |
We recently updated our helm charts to apiversion 2 and are therefore using the helm3 flag (i.e.
helm unittest -3 .
) to execute our test suites.Unfortunately, when running multiple test jobs within a test suite, values provided via
set
in one test job are still present in every consecutive test job. This causes assertions of the consecutive jobs to fail, due to the set assumptions no longer being valid.I tried debugging and noticed that the call to
v3engine.Render(filteredChart, vals)
actually manipulates thefilteredChart.Values
field on thev3chart.Chart
struct. This is really counterintuitive because one might assume that values from a chart are immutable.helm-unittest/pkg/unittest/test_job.go
Lines 447 to 450 in c283e70
Since
filteredChart.Values
seems to be pointing to the same location astargetChart.Values
, the next test job run in the suite will end up with values altered by previous test jobs.The text was updated successfully, but these errors were encountered: