quintush / helm-unittest

BDD styled unit test framework for Kubernetes Helm charts as a Helm plugin.
MIT License
344 stars 69 forks source link

Not helpful error #109

Closed svobol13 closed 1 year ago

svobol13 commented 3 years ago

Hello, I have a question why do I get errors like:

incompatible types for comparison

instead of error like:

template: generic-release/templates/deployment.yaml:106:35: executing "deployment" at <eq "tmpfs">: error calling eq: incompatible types for comparison

The original error would be really helpful to me. I am really often unable to find out why my test is failing unless I run the test with debug mode. I found that the alot of information is trimmed from the error here: https://github.com/quintush/helm-unittest/blob/1693f4f0a35624b1c3f6453d4f0893758e3d99a3/pkg/unittest/test_job.go#L466

Why not to throw whole error as is?

quintush commented 3 years ago

Hello @svobol13,

Thanks for the feedback.

There is indeed a reason that the error is trimmed. When the assertion on failed messages was created, the trimming was the only option to verify the failure message.

I will try to set the trimmed error and the original error. When no failure assertion is net, it will show the original error.

Hopefully this will improve in identifying failures.

Greetings, @quintush

quintush commented 3 years ago

Hello @svobol13,

I have created a fix that will show the complete error.

Will try to create a release within the following days.

Greetings, @quintush