Hull will use this output to further render only the yaml files so that they may be tested. However, Hull is (properly) using the filepath.Seperator constant to split template names from their paths to identify the yaml files. By splitting the value using the filepath.Seperator constant, as well as the immediate indexing into the resulting slice, we run into the above error.
The fix proposed in this PR is to no longer use the filepath.Seperator constant, as Helm will always return linux path separators. This results in Hull tests working as expected on Windows, and does not impact linux/macos. Changing this in Helm itself would likely be a major breaking change, as this logic has existed for ~7 years.
While running chart tests on windows, I noticed that hull would error out with the following log:
After investigating, this issue seems to stem from how the Helm API returns charts after calling
c.Render
within HullsRenderTemplate
function.As the Helm API recurses through the chart files, it builds out the file paths using the
path
library. Unfortunately, thepath
library does not take into account OS specific file separators, onlypath/filepath
does.Hull will use this output to further render only the yaml files so that they may be tested. However, Hull is (properly) using the
filepath.Seperator
constant to split template names from their paths to identify the yaml files. By splitting the value using thefilepath.Seperator
constant, as well as the immediate indexing into the resulting slice, we run into the above error.The fix proposed in this PR is to no longer use the
filepath.Seperator
constant, as Helm will always return linux path separators. This results in Hull tests working as expected on Windows, and does not impact linux/macos. Changing this in Helm itself would likely be a major breaking change, as this logic has existed for ~7 years.