You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just started using this tool and I'm trying to write tests for a chart that uses named templates and finding that the order of documents that unittest renders is different from that generated by helm template.
For instance if I have a chart with a named template for an Ingress resource and another for a ConfigMap resource, then I have one template file that includes the ingress first and then the configmap, helm template will actually show the ConfigMap first and then the Ingress. Then if I write a test to validate that the first document is a ConfigMap it fails and says that it is an Ingress. Furthermore, if I switch the order of the includes the output of helm template doesn't change, but it does change the result of the test.
I assume that there is some kind of sorting going on in helm template that isn't happening with unittest. Barring changing the way that unittest works (I assume that this change would be non-trivial), is there a way either with unittest or helm that you know of for at least seeing the order of documents as unittest sees them? As it is finding the right index is trial and error.
I'm using helm 3.8.1 and unittest 0.2.8.
The text was updated successfully, but these errors were encountered:
Ran into this recently also.
Must have several templates defined in the templates array, due to one include'ing the other. Then the assertion returns this:
The rendering of the 0.2.8 helm unittest is done with the 3.7.1 library, so the behaviour can indeed be different.
I will try to update the libraries more regular, to align with the latest version.
I just started using this tool and I'm trying to write tests for a chart that uses named templates and finding that the order of documents that unittest renders is different from that generated by helm template.
For instance if I have a chart with a named template for an Ingress resource and another for a ConfigMap resource, then I have one template file that includes the ingress first and then the configmap,
helm template
will actually show the ConfigMap first and then the Ingress. Then if I write a test to validate that the first document is a ConfigMap it fails and says that it is an Ingress. Furthermore, if I switch the order of theinclude
s the output ofhelm template
doesn't change, but it does change the result of the test.I assume that there is some kind of sorting going on in helm template that isn't happening with unittest. Barring changing the way that unittest works (I assume that this change would be non-trivial), is there a way either with unittest or helm that you know of for at least seeing the order of documents as unittest sees them? As it is finding the right index is trial and error.
I'm using helm 3.8.1 and unittest 0.2.8.
The text was updated successfully, but these errors were encountered: