Skip to content

Conversation

@quintush
Copy link
Contributor

Add additional testcases for isEmpty assertion (resolves #134)

The example uses the gotpl with statement which works as an if statement on even on empty objects.
https://helm.sh/docs/chart_template_guide/control_structures/#modifying-scope-using-with

As the key is never rendered, only isNull is a valid validation.
A foundable key with a null value is still valid to check with the isEmpty.

@sonarqubecloud
Copy link

@quintush quintush merged commit 06886d8 into main Apr 17, 2023
@quintush quintush deleted the buggix/IsEmptyAssertion branch May 8, 2023 20:45
mbaldessari pushed a commit to mbaldessari/gitea-helm-chart that referenced this pull request Feb 10, 2024
While working on #409, I noticed that some unittests contains either invalid assertion methods (`isNotEmpty`) or invalid properties (`any`) for a specific assertion method (`notContains`). As our tests pass - and I have ensured that they can fail - this seems related to the YAML schema validation in the IDE. I've noticed that `isNotEmpty` was replaced by `isNotNullOrEmpty`[^1] in version v0.3.2[^2]. At least from a schema validation point of view. It is still working. Maybe deprecated? I don't know. Regarding the `any` property, the documentation seems incorrect. I've filed a PR for it[^3]. As soon as that PR is merged and released, we could probably validate the test YAML files in our PR workflow. Last, since we renovate the used helm-unittest version, we should also renovate the used YAML schema file. [^1]: helm-unittest/helm-unittest#139 [^2]: https://github.com/helm-unittest/helm-unittest/releases/tag/v0.3.2 [^3]: helm-unittest/helm-unittest#243 Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/570 Reviewed-by: pat-s <pat-s@noreply.gitea.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants