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

refactor: unit test document hanlding #3142

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

hisImminence
Copy link
Contributor

@hisImminence hisImminence commented Mar 9, 2025

Which problem does the PR fix?

Trying to make the unit tests more generic and easier to read - I did the following refactorings:

  1. Created 3 functions that could be used by all configmap unit tests actually --> they could be moved into a go package and reused in other configmap tests:
    • renderTemplate(): renders configmap template (used in all tests before)
    • verifyConfigMap(): compares expected vs. set (used in all tests before)
    • runTestCases(): runs all testCases (see point 2.)
  2. Created a testCase structure instead of single test functions. This makes it very visible to see what values (in values.yaml) I set and which values (in this case envVars) I expect to set. The struct looks like:
    2.1. name of the testCase
    2.2. all values that we are setting in the values.yaml.
    2.3 all expected values (in this case envVars), which should be set after the configmap got rendered.

p.s. lets wait for https://github.com/camunda/camunda-platform-helm/pull/3141/files to be merged as it removes the local option.

What's in this PR?

Checklist

Please make sure to follow our Contributing Guide.

Before opening the PR:

  • In the repo's root dir, run make go.update-golden-only.
  • There is no other open pull request for the same update/change.
  • Tests for charts are added (if needed).
  • In-repo documentation are updated (if needed).

After opening the PR:

  • Did you sign our CLA (Contributor License Agreement)? It will show once you open the PR.
  • Did all checks/tests pass in the PR?

@github-actions github-actions bot added the version/alpha Camunda applications/cycle version (this is a pointer to alpha) label Mar 9, 2025
@hisImminence hisImminence force-pushed the refactor-unit-test-dochandling branch from 3a4f7e1 to 2628fa6 Compare March 9, 2025 02:19
@hisImminence hisImminence changed the title Refactor unit test dochandling refactor: unit test document hanlding Mar 9, 2025
@hisImminence hisImminence force-pushed the refactor-unit-test-dochandling branch from bf941f7 to 4ff6128 Compare March 9, 2025 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version/alpha Camunda applications/cycle version (this is a pointer to alpha)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant