-
Notifications
You must be signed in to change notification settings - Fork 13
fix(testing): Add Variable expansion testing #558
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
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughAdds a Helm test generator and test manifest to validate environment-variable expansion for operator-wandb, renames/ inlines ClickHouse env template, updates ClickHouse address templating, and bumps the chart version. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer/CI
participant Gen as generate-env-tests.go
participant Chart as Chart.yaml (charts/)
participant Values as values.yaml (charts/)
participant TestFile as templates/tests/test-env-expansion.yaml
participant K8s as Kubernetes (helm test)
Dev->>Gen: run generator (chart name)
Gen->>Chart: load Chart.yaml dependencies
Chart-->>Gen: wandb-base service aliases
Gen->>Values: load values.yaml
Values-->>Gen: per-service env/envFrom/envTpls
Gen->>TestFile: emit anchor + per-service containers
TestFile-->>Gen: test manifest written
Dev->>K8s: deploy/run helm test
K8s->>K8s: run anchor container (env validation)
K8s->>K8s: run per-service env-check containers (grep for '$(VARIABLE)')
K8s-->>Dev: test pass/fail
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
Add dynamic test generator for environment variable validation
Implement
snapshots.sh generate-env-teststo automatically generatetest-env-expansion.yaml from Chart.yaml and values.yaml. This creates
individual test containers for each service that validate environment
variables don't contain unresolved shell-style $(VAR) references.
Key features:
The test prevents accidentally shipping configurations with unresolved
variable references like:
GORILLA_GLUE_CLICKHOUSE_ADDRESS="http://$(WF_CLICKHOUSE_HOST)"when
WF_CLICKHOUSE_HOSTisn't defined in that service's environment.Here is an example of one such case:
Summary by CodeRabbit
New Features
Tests
Chores