Improve experience on writing unittests #570

Merged
justusbunsi merged 2 commits from justusbunsi/helm-chart:contributor-experience-unittests into main 2023-11-27 18:38:14 +00:00
Member

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 isNotNullOrEmpty1
in version v0.3.22. 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 it3. 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.

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]: https://github.com/helm-unittest/helm-unittest/pull/139 [^2]: https://github.com/helm-unittest/helm-unittest/releases/tag/v0.3.2 [^3]: https://github.com/helm-unittest/helm-unittest/pull/243
justusbunsi added the
skip-changelog
label 2023-11-18 12:29:53 +00:00
justusbunsi added 1 commit 2023-11-18 12:29:54 +00:00
Improve experience on writing unittests
While working on #409, I noticed that there 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 validation point of view.
It is still working. Maybe deprecated? I don't know.

Regarding the `any` property, the documentation seems not correct. 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]: https://github.com/helm-unittest/helm-unittest/pull/139
[^2]: https://github.com/helm-unittest/helm-unittest/releases/tag/v0.3.2
[^3]: https://github.com/helm-unittest/helm-unittest/pull/243

Signed-off-by: justusbunsi <sk.bunsenbrenner@gmail.com>
All checks were successful
check-and-test / check-and-test (pull_request) Successful in 31s
d763530596
justusbunsi requested review from pat-s 2023-11-18 12:30:04 +00:00
pat-s approved these changes 2023-11-18 17:10:45 +00:00
pat-s left a comment
Member

Nice find.

I guess renovate won't be able to fetch schema diffs in the changelog but anyhow - surely good to fix it!

Nice find. I guess renovate won't be able to fetch schema diffs in the changelog but anyhow - surely good to fix it!
justusbunsi removed the
skip-changelog
label 2023-11-18 17:18:55 +00:00
Author
Member

Yep, Renovate most likely doesn't detect those changes. But we will receive one single dependency bump for all occurrences of the unittest plugin. And that should have the changelog from its GitHub release.

Yep, Renovate most likely doesn't detect those changes. But we will receive one single dependency bump for all occurrences of the unittest plugin. And that should have the changelog from its GitHub release.
justusbunsi added 1 commit 2023-11-27 18:37:33 +00:00
Merge branch 'main' into contributor-experience-unittests
All checks were successful
check-and-test / check-and-test (pull_request) Successful in 29s
b49a665439
justusbunsi merged commit b265d87f55 into main 2023-11-27 18:38:14 +00:00
justusbunsi deleted branch contributor-experience-unittests 2023-11-27 18:38:15 +00:00
Sign in to join this conversation.
No description provided.