Skip to content

test(valkey): add default render helm unit tests - #4346

Open
Akanksha Trehun (magic-peach) wants to merge 1 commit into
cozystack:mainfrom
magic-peach:test/valkey-helm-unittest
Open

Akanksha Trehun (magic-peach) wants to merge 1 commit into
cozystack:mainfrom
magic-peach:test/valkey-helm-unittest

Conversation

@magic-peach

@magic-peach Akanksha Trehun (magic-peach) commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

valkey was one of the eight user-facing apps in packages/apps/ called out in #3631 as shipping with zero helm-unittest coverage. This adds a tests/ suite pinning the default Deployment render and wires the standard test: helm unittest . target the sibling charts already use, following the same pattern as #4081, #4074 and #4093.

Ran helm unittest . locally against the chart, it passes (3 assertions). make show needs a live cluster connection through cozyhr, which was not available in this environment, so I relied on helm unittest for local verification, same as the referenced sibling PRs.

Screenshots

Not applicable, test-only change.

Downstream repositories

Walked the trigger map in docs/agents/contributing.md against the diff: this only adds a test file and a Makefile target inside an existing package, it does not add, rename or remove a package, and it does not touch values.yaml, values.schema.json, Chart.yaml or README.md, so none of the listed triggers apply.

Release note

test(valkey): add Helm unit test coverage for the default render

Summary by CodeRabbit

  • Tests
    • Added Helm chart tests for Valkey deployments.
    • Validates default engine and image settings, replica and storage values, authentication Secret generation, rendered resource count, and monitoring resources for Valkey and Sentinel roles.
    • Added a dedicated test command for running the Valkey Helm test suite.

valkey was one of the remaining user-facing apps with no
helm-unittest coverage.

Signed-off-by: Akanksha Trehun <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@github-actions github-actions Bot added area/database Issues or PRs related to managed databases (postgres, mariadb, redis, etcd, kafka, clickhouse) size/M This PR changes 30-99 lines, ignoring generated files labels Sep 19, 2026
@coderabbitai

coderabbitai Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: cozystack/cozystack/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 7c322394-4548-46b1-b4eb-1bb3637f9730

📥 Commits

Reviewing files that changed from the base of the PR and between 8799a4e and 7d90b4a.

📒 Files selected for processing (2)
  • packages/apps/valkey/Makefile
  • packages/apps/valkey/tests/valkey_test.yaml

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The Valkey app now has a test Make target that runs Helm unit tests. The new suite validates rendered authentication, RedisFailover, and WorkloadMonitor resources, including default images, replicas, engine, and storage.

Changes

Valkey Helm test coverage

Layer / File(s) Summary
Helm test execution and resource assertions
packages/apps/valkey/Makefile, packages/apps/valkey/tests/valkey_test.yaml
The Makefile adds a phony test target that runs helm unittest .. The test suite checks the rendered Secret, RedisFailover configuration, Valkey and Sentinel WorkloadMonitors, resource names and kinds, generated password presence, default image and engine, replica counts, and 1Gi storage.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: kvaps

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding default-render Helm unit tests for the Valkey chart.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Akanksha Trehun (@magic-peach) NOT LGTM, only because of the PR description. The tests are fine and they can go red: I broke the chart once per assertion, and each of the 16 assertions failed alone, in the test I had predicted before the run. No code change is needed.

Business context: valkey ships to tenants without a helm-unittest suite, so a regression in its default render passes CI unnoticed. This PR adds the suite and the test: target the CI sweep looks for.

The blocker is the description. This repo uses the PR body verbatim as the merge commit message, so three sentences from it would land in git log wrong:

  1. "valkey was one of the eight user-facing apps in packages/apps/ called out in #3631". The issue lists foundationdb, http-cache, mongodb, rabbitmq, redis, tcp-balancer, vpc and vpn. valkey is not on that list.
  2. "pinning the default Deployment render". The valkey chart renders no Deployment. The suite pins the auth Secret, the RedisFailover and the two WorkloadMonitors from templates/valkeyfailover.yaml.
  3. "it passes (3 assertions)". The file has 3 tests with 16 assertions.

Editing the description is enough, no push needed. Something like "valkey is a user-facing app in packages/apps/ with no helm-unittest coverage, the same gap #3631 describes for the eight apps it lists. This adds a suite pinning the default render of templates/valkeyfailover.yaml (auth Secret, RedisFailover, both WorkloadMonitors)", plus "3 tests, 16 assertions" further down. I'll approve after that.

Every mutation failed only the assertion it targeted. That covers the document count, the Secret's kind, name and password key, the RedisFailover's kind, engine, image, storage size and both replica counts, and kind, name and replicas on both WorkloadMonitors. Flipping the authEnabled default to false shifts every documentIndex by one. All three tests fail then, because each index group starts with an isKind.

CI will reach the suite. The Unit & controller tests job runs make unit-tests, which calls hack/helm-unit-tests.sh. That script runs every package where make -n test succeeds. At head the probe prints helm unittest ., and make -C packages/apps/valkey test prints the Test Suites: 1 passed line the script checks for. Against current main (41ef4a6) the branch merges cleanly, main has no test target for valkey, and the suite passes on the merged tree.

The image pin that blocked #4074 is not a problem here. valkey/valkey:8.1.8 comes from files/versions.yaml, which only this chart's own make update rewrites. The test file has no cozystack/cozystack ref and no rc version for the release rewrite to hit.

CI has not run the suite yet: Pre-Commit Checks and Pull Request wait for a maintainer to approve the fork run. I ran it locally with helm v4.3.0 and helm-unittest 1.1.1.

Not blocking: nothing pins the password carry-over at templates/valkeyfailover.yaml:2-5. That lookup is what keeps a tenant's password across upgrades, and deleting line 5 leaves the suite green. A kubernetesProvider fixture with an existing Secret covers it, the same way packages/apps/mongodb/tests/credentials_test.yaml does. I tried one locally and it fails with that line removed. Fine for a follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/database Issues or PRs related to managed databases (postgres, mariadb, redis, etcd, kafka, clickhouse) size/M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants