-
Notifications
You must be signed in to change notification settings - Fork 0
chore: better tests #24
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
Conversation
|
Warning Rate limit exceeded@patrickleet has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 13 minutes and 26 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (21)
📝 WalkthroughWalkthroughA comprehensive test suite for AWS IPAM configuration was added to Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
Pre-merge checks❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
Comment |
Published Crossplane PackageThe following Crossplane package was published as part of this PR: Package: ghcr.io/hops-ops/configuration-aws-ipam:pr-24-b738851c76bc881c8fdac39213b2d7c57ff525ed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
tests/test-render/main.k (3)
209-247: Consider adding a negative assertion for operating-regions test.This test verifies that
operatingRegionsincludes all unique regions fromspec.operatingRegions,spec.region, and poollocale. However, it lacksobservedResources, which is fine for testing rendering logic. Consider also verifying no duplicate regions appear (e.g., ifus-east-1were added to bothoperatingRegionsand as the mainregion).
500-553: Gating test is important but could be more explicit.The test verifies that child pool doesn't render when parent isn't ready, but the assertion only checks that the parent pool exists. Consider adding a negative assertion mechanism if the test framework supports it, to explicitly verify the child pool (
test-child-wait-child) is absent.
1131-1197: Verify netmaskLength test doesn't assert cidr absence.The test verifies
VPCIpamPoolCidrusesnetmaskLength = 16, but doesn't explicitly check thatcidris absent. If the composition could erroneously set both fields, this test wouldn't catch it. Consider verifying the expected behavior more explicitly if the framework supports it.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
tests/test-render/kcl.mod.lockis excluded by!**/*.lock
📒 Files selected for processing (1)
tests/test-render/main.k
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: hops-ops/configuration-aws-ipam PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-26T00:25:17.341Z
Learning: Applies to examples/ipams/*.yaml : Add new examples under `examples/ipams/` before writing assertions in tests.
Learnt from: CR
Repo: hops-ops/configuration-aws-ipam PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-26T00:25:17.341Z
Learning: Applies to functions/render/**/*.gotmpl : Keep resources split per file: `05-ipam` for `VpcIpam` + `VpcIpamScope`, `10-ipam-pools` for `VpcIpamPool` + `VpcIpamPoolCidr`, and `90-observed-values` + `99-status` for status projection.
📚 Learning: 2025-12-26T00:25:17.341Z
Learnt from: CR
Repo: hops-ops/configuration-aws-ipam PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-26T00:25:17.341Z
Learning: Applies to functions/render/**/*.gotmpl : Keep resources split per file: `05-ipam` for `VpcIpam` + `VpcIpamScope`, `10-ipam-pools` for `VpcIpamPool` + `VpcIpamPoolCidr`, and `90-observed-values` + `99-status` for status projection.
Applied to files:
tests/test-render/main.k
📚 Learning: 2025-12-26T00:25:17.341Z
Learnt from: CR
Repo: hops-ops/configuration-aws-ipam PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-26T00:25:17.341Z
Learning: Applies to examples/ipams/*.yaml : Add new examples under `examples/ipams/` before writing assertions in tests.
Applied to files:
tests/test-render/main.k
📚 Learning: 2025-12-26T00:25:17.341Z
Learnt from: CR
Repo: hops-ops/configuration-aws-ipam PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-26T00:25:17.341Z
Learning: Update examples, README, and tests in the same change whenever you add schema knobs to `apis/ipams/definition.yaml`.
Applied to files:
tests/test-render/main.k
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: publish / publish
- GitHub Check: e2e / test
🔇 Additional comments (5)
tests/test-render/main.k (5)
4-12: Well-documented test philosophy.The philosophy comments clearly explain the testing approach: focusing on API behavior rather than provider implementation details. This is an excellent practice for composition tests.
21-80: Basic defaults test looks correct.The test properly validates that minimal spec input produces expected defaults:
managementPolicies = ["*"],providerConfigRef = {name = "default", kind = "ProviderConfig"}, andtags = {hops = "true"}.
812-873: Good test for management policies inheritance.The test correctly verifies that global
managementPolicies = ["Observe"]cascades to bothVPCIpamPoolandVPCIpamPoolCidrresources.
998-1030: Pool gating test validates critical sequencing.This test ensures pools don't render until the IPAM is ready and provides
privateDefaultScopeId. The emptyobservedResources = []and assertion of onlyVPCIpamcorrectly validates this gating behavior.
14-1237: Comprehensive and well-organized test suite.The test suite covers a wide range of scenarios including:
- Default values and inheritance
- Provider config variations
- Tag merging
- Operating regions auto-computation
- Pool constraints and locales
- IPv6 ULA and GUA pools
- Parent/child pool relationships and gating
- External name adoption for IPAM, pools, CIDRs, and scopes
- Custom scopes and scope references
- Management policy inheritance and overrides
- Label propagation
- forProvider passthrough fields
The consistent structure with "When/Then" comments makes tests easy to understand. Based on learnings, ensure corresponding examples exist under
examples/ipams/for any new schema knobs being tested.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.