vbehar / helm3-unittest

Fork of lrills/helm-unittest but for Helm 3
MIT License
21 stars 10 forks source link

Assert failure #12

Open arnouthoebreckx opened 2 years ago

arnouthoebreckx commented 2 years ago

Hi,

Would it be possible to add an assertiontype where error would be accepted.

The use case for this is that in our charts we often use the required and or fail command to indicate that something is not setup correctly. We would like to write test cases for this to check that it's always covered.

Could be something like this

- it: Test failure
    set:
      image.tag: latest
    asserts:
      - hasFailed:
          pattern: '[0-9]+ tag is not valid'

Which would check against the error message. This could be with regex support or even just fixed string.