Skip to content
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

.Files empty in test context #229

Open
maxnitze opened this issue Oct 29, 2023 · 1 comment
Open

.Files empty in test context #229

maxnitze opened this issue Oct 29, 2023 · 1 comment
Labels

Comments

@maxnitze
Copy link

I have a weird issue in one of my tests: I'm testing, if that I can add additional files from a given path to a template. Manually I verified, that it works. But I cannot get my tests working. The file is never added.

I then checked, what the .Files known to the current context are. To do that I added the following to my template in test:

{{- fail (printf "files = %s" $.Files) }}

When I render the chart manually the fail message shows a couple of files (README.md, .helmignore and my unittestfiles/certificates/myCustomRootCA.pem).

When I execute my tests though, the error message is "files = map[]".

Is this by design? If not, is this a known issue?

@quintush
Copy link
Contributor

quintush commented Dec 5, 2023

Hello @maxnitze,

Sorry for the delayed response.
Can you add an example of the test that is being used?

When templates are defined in the test suite, all other files (except for the partial templates) are excluded, to ensure we don't get invalid rendered charst due to required fields in not part of the tested resources.
This behaviour could conflict with the $.Files, but I'm not sure yet.

Greetings,
@quintush

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants