HYPERFLEET-1321 - test: add entity render scenarios and refactor test-helm script#282
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughMoves Helm validation out of Estimated code review effort: 4 (Complex) | ~45 minutes Suggested labels: ci, testing, dependencies, supply-chain Suggested reviewers: platform-team, ci-maintainers CWE-494: external schema locations are consumed by kubeconform during chart validation. 🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
Risk Score: 2 —
|
| Signal | Detail | Points |
|---|---|---|
| PR size | 642 lines (>500) | +2 |
| Sensitive paths | none | +0 |
Computed by hyperfleet-risk-scorer
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/test-helm.sh`:
- Around line 42-75: The assertion helpers in assert_contains and
assert_not_contains currently return a non-zero status on failure, which
triggers set -e and stops script execution before the summary and remaining
tests run. Update these functions so they still call fail() but return 0
afterward, allowing the top-level test calls to continue while FAILED/PASSED
counters and the final exit check in the script handle overall failure.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 2f603277-6b3e-4b94-a8fe-9361584c23d9
📒 Files selected for processing (3)
Makefilecharts/ci/entities-all-fields-values.yamlscripts/test-helm.sh
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
openshift-hyperfleet/architecture(manual)openshift-hyperfleet/hyperfleet-api(manual)openshift-hyperfleet/hyperfleet-sentinel(manual)openshift-hyperfleet/hyperfleet-adapter(manual)openshift-hyperfleet/hyperfleet-broker(manual)
86113dd to
386ec0d
Compare
386ec0d to
1b028d5
Compare
|
/retest |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/test-helm.sh`:
- Around line 9-14: The kubeconform remote schema source in the
KUBECONFORM_FLAGS setup is pinned to the mutable datreeio/CRDs-catalog main
branch, which should be made immutable. Update the schema-location used in
scripts/test-helm.sh to reference a fixed tag or commit SHA instead of main, and
keep the existing KUBECONFORM_FLAGS array entry and kubeconform invocation
aligned with that pinned source.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 5b3e6ad1-7f32-41cb-94c4-d5f07576e40e
⛔ Files ignored due to path filters (1)
.bingo/yq.sumis excluded by!**/*.sum
📒 Files selected for processing (6)
.bingo/Variables.mk.bingo/variables.env.bingo/yq.modMakefilecharts/ci/entities-all-fields-values.yamlscripts/test-helm.sh
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
openshift-hyperfleet/architecture(manual)openshift-hyperfleet/hyperfleet-api(manual)openshift-hyperfleet/hyperfleet-sentinel(manual)openshift-hyperfleet/hyperfleet-adapter(manual)openshift-hyperfleet/hyperfleet-broker(manual)
✅ Files skipped from review due to trivial changes (2)
- .bingo/variables.env
- .bingo/yq.mod
🚧 Files skipped from review as they are similar to previous changes (2)
- Makefile
- charts/ci/entities-all-fields-values.yaml
46e04cd to
a07a4b3
Compare
|
Re: PR title / commit message Warning Blocking Category: Standards The PR title / commit subject is 77 chars (excluding the Since this repo uses squash merges, the PR title is the final commit message — worth shortening both. Something like: (63 chars for the |
|
Are there any plans to use helm unittest in the future? |
a07a4b3 to
08fd23f
Compare
|
@Ruclo Not at the moment — the current shell-based approach covers our needs (lint, template rendering, kubeconform validation, YAML parsing, and content assertions). helm-unittest would give us snapshot testing and more structured assertions, but it also adds another tool dependency and a different test authoring style. Open to revisiting if the test scenarios grow more complex or if the team sees value in it. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tirthct The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@rafabene: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Summary
test-helmscenarios that render the configmap with entities configured (Channel, Version, WifConfig), validate the renderedconfig.yamlis parseable YAML (python3 yaml.safe_load), and run kubeconform — would have caught the HYPERFLEET-1320 bug before mergescripts/test-helm.shwith reusable helper functions (render,assert_contains,validate_yaml,extract_config_yaml)charts/ci/entities-all-fields-values.yamltest fixture exercising all optional entity fields (parent_kind,on_parent_delete,references,required_adapters)Test plan
make test-helmpasses all 21 scenariosmake lintpasses with 0 issues