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

Template path is translated differently #300

Open
cyfu opened this issue Feb 23, 2024 · 0 comments
Open

Template path is translated differently #300

cyfu opened this issue Feb 23, 2024 · 0 comments
Assignees
Labels

Comments

@cyfu
Copy link

cyfu commented Feb 23, 2024

In the test/data/v3/with-subchart folder, run helm unittest . command, all the test suites pass as expected.
but if I just want to run one of the test suite, by specifying test suite file name,
helm unittest . -f charts/child-chart/tests/deployment_test.yaml, it fails to translate the templates path.

 FAIL  test deployment  charts/child-chart/tests/deployment_test.yaml
        - should pass all kinds of assertion

                - asserts[3] `matchRegex` fail
                        Template:       with-subchart/templates/deployment.yaml
                        DocumentIndex:  0
                        Path:   metadata.name
                        Expected to match:
                                ^.*-child-chart$
                        Actual:
                                RELEASE-NAME-with-subchart

In the charts/child-chart/tests/deployment_test.yaml file,

templates:
  - templates/deployment.yaml

templates/deployment.yaml now is translated to with-subchart/templates/deployment.yaml, it should be with-subchart/charts/child-chart//templates/deployment.yaml. And the test values file also needs to be adjusted to move under the subchart.

The expectation is test suites always be executed under the same context, no matter how the cli command is executed.

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