test: allow override for postgres image in integration tests - #61
Conversation
- Add POSTGRES_IMAGE variable to test/Makefile to allow overriding the postgres image at test runtime; defaults to chart default when not set - Replace hardcoded pgedge-helm-utils:dev literals with $(INIT_SPOCK_IMAGE) variable throughout test/Makefile for consistency - Log test configuration at startup (CHART_REF, CHART_VERSION, HELM_REPO, INIT_SPOCK_IMAGE, POSTGRES_IMAGE) for easier debugging
📝 WalkthroughWalkthroughThe PR introduces configurable Docker image support to the test infrastructure. Make variables for ChangesConfigurable Test Images
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
test/Makefile (1)
67-67: 💤 Low valueConsider documenting that POSTGRES_IMAGE is not loaded into kind.
The
kind-load-imagetarget loads onlyINIT_SPOCK_IMAGEinto the kind cluster. UnlikeINIT_SPOCK_IMAGE(which defaults to a localpgedge-helm-utils:devimage),POSTGRES_IMAGEis expected to be pulled from a registry. A brief comment explaining this asymmetry would help future maintainers understand whyPOSTGRES_IMAGEisn't loaded here.🤖 Prompt for 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. In `@test/Makefile` at line 67, Add a brief comment in the kind-load-image target explaining that only INIT_SPOCK_IMAGE is loaded into the kind cluster (via the existing kind load docker-image $(INIT_SPOCK_IMAGE) --name $(KIND_CLUSTER_NAME)) while POSTGRES_IMAGE is intentionally not loaded and is expected to be pulled from a registry; reference the variables INIT_SPOCK_IMAGE and POSTGRES_IMAGE and mention the asymmetry so future maintainers understand why POSTGRES_IMAGE isn't handled here.
🤖 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 `@test/integration/suite_test.go`:
- Line 34: Remove the leftover debug print statement fmt.Fprintf(os.Stdout,
"DEBUG os.Getenv POSTGRES_IMAGE=%q\n", os.Getenv("POSTGRES_IMAGE")) from the
test file (suite_test.go) so the redundant output is gone; also update imports
(remove fmt if it becomes unused) to keep the test compile-clean and rely on the
existing "Test configuration" logging block instead.
---
Nitpick comments:
In `@test/Makefile`:
- Line 67: Add a brief comment in the kind-load-image target explaining that
only INIT_SPOCK_IMAGE is loaded into the kind cluster (via the existing kind
load docker-image $(INIT_SPOCK_IMAGE) --name $(KIND_CLUSTER_NAME)) while
POSTGRES_IMAGE is intentionally not loaded and is expected to be pulled from a
registry; reference the variables INIT_SPOCK_IMAGE and POSTGRES_IMAGE and
mention the asymmetry so future maintainers understand why POSTGRES_IMAGE isn't
handled here.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3d564b07-a6ad-44a3-b75e-5598103f2001
📒 Files selected for processing (3)
test/Makefiletest/README.mdtest/integration/suite_test.go
|
|
||
| func TestMain(m *testing.M) { | ||
|
|
||
| fmt.Fprintf(os.Stdout, "DEBUG os.Getenv POSTGRES_IMAGE=%q\n", os.Getenv("POSTGRES_IMAGE")) |
There was a problem hiding this comment.
Remove the debug print statement.
This debug output is redundant with the cleaner "Test configuration" block at lines 56–61 and appears to be leftover debugging code.
🧹 Proposed fix
-
- fmt.Fprintf(os.Stdout, "DEBUG os.Getenv POSTGRES_IMAGE=%q\n", os.Getenv("POSTGRES_IMAGE"))
-
kubeContext = envOrDefault("KUBECONTEXT", "kind-pgedge-test")📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| fmt.Fprintf(os.Stdout, "DEBUG os.Getenv POSTGRES_IMAGE=%q\n", os.Getenv("POSTGRES_IMAGE")) | |
| kubeContext = envOrDefault("KUBECONTEXT", "kind-pgedge-test") |
🤖 Prompt for 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.
In `@test/integration/suite_test.go` at line 34, Remove the leftover debug print
statement fmt.Fprintf(os.Stdout, "DEBUG os.Getenv POSTGRES_IMAGE=%q\n",
os.Getenv("POSTGRES_IMAGE")) from the test file (suite_test.go) so the redundant
output is gone; also update imports (remove fmt if it becomes unused) to keep
the test compile-clean and rely on the existing "Test configuration" logging
block instead.
No description provided.