SPLAT-2713: Update AWS CCM e2e test module version#476
Conversation
Updates the AWS CCM e2e tests module version to the latest version which includes changes like the addition of e2e tests for the BYO Security Group for AWS Network Load Balancer feat.
|
Skipping CI for Draft Pull Request. |
|
@mfbonfigli: This pull request references SPLAT-2713 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
Warning Review limit reached
More reviews will be available in 1 minute and 37 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
WalkthroughThis PR consolidates AWS region validation and discovery into shared helpers, refactors the AWS test helper and main entrypoint to use those shared helpers with validation and fallback logic, makes a controller test assertion more robust with retry logic, and updates an e2e test dependency. ChangesAWS Region Discovery and Validation Refactoring
Test Robustness and Dependency Update
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 12 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (12 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 |
|
/retest |
1 similar comment
|
/retest |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
pkg/controllers/cloud_config_sync_controller_test.go (1)
607-611: ⚡ Quick winAdd descriptive failure message to assertion.
The assertion lacks a custom failure message. Adding one would improve debuggability when the test fails by clearly explaining what condition was expected.
📝 Proposed fix to add failure message
Eventually(func() int { allCMs := &corev1.ConfigMapList{} Expect(cl.List(ctx, allCMs, &client.ListOptions{Namespace: targetNamespaceName})).To(Succeed()) return len(allCMs.Items) -}).Should(BeZero()) +}, 10*time.Second, 100*time.Millisecond).Should(BeZero(), "Expected no ConfigMaps to be created for BareMetal platform")As per coding guidelines: "Assertions should include meaningful failure messages."
🤖 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 `@pkg/controllers/cloud_config_sync_controller_test.go` around lines 607 - 611, The Eventually assertion that checks the ConfigMap count is zero lacks a custom failure message, which makes debugging harder when the test fails. Add a descriptive failure message to the Eventually().Should(BeZero()) assertion chain to explain what condition is expected. Use the appropriate Gomega method (such as WithMessage or similar) to attach a clear error message that will be displayed if the assertion fails, explaining that all ConfigMaps in the target namespace should be cleaned up or deleted.Source: Coding guidelines
🤖 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 `@pkg/controllers/cloud_config_sync_controller_test.go`:
- Around line 607-611: The Eventually block that lists ConfigMaps in the
targetNamespace lacks an explicit timeout parameter, which can cause the test to
hang indefinitely if the reconciler misbehaves. Add a timeout argument to the
Eventually function call (something like Eventually(func(), timeout.Duration))
to ensure the test fails gracefully if ConfigMaps are not cleaned up within a
reasonable timeframe. Include both the timeout and optionally a polling interval
to comply with Ginkgo testing guidelines for cluster-interacting operations.
---
Nitpick comments:
In `@pkg/controllers/cloud_config_sync_controller_test.go`:
- Around line 607-611: The Eventually assertion that checks the ConfigMap count
is zero lacks a custom failure message, which makes debugging harder when the
test fails. Add a descriptive failure message to the
Eventually().Should(BeZero()) assertion chain to explain what condition is
expected. Use the appropriate Gomega method (such as WithMessage or similar) to
attach a clear error message that will be displayed if the assertion fails,
explaining that all ConfigMaps in the target namespace should be cleaned up or
deleted.
🪄 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: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 9c0dba32-c5a4-4248-b5a6-ca9e439cf1a3
📒 Files selected for processing (1)
pkg/controllers/cloud_config_sync_controller_test.go
|
/retest |
|
/test e2e-aws-ovn-upgrade |
mtulio
left a comment
There was a problem hiding this comment.
Overall LGTM. I see two commits with the same purpose: fixing the unit test on pkg/controllers/cloud_config_sync_controller_test.go.
Would you mind squashing those?
|
/test ? |
|
@mtulio: The following commands are available to trigger required jobs: The following commands are available to trigger optional jobs: Use DetailsIn response to this:
Instructions 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. |
|
/payload-job periodic-ci-openshift-hypershift-release-5.0-periodics-e2e-aws-ovn-conformance-ccm-techpreview |
|
@mtulio: trigger 0 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command |
Wrap the ConfigMap list assertion in Eventually with an explicit 2-minute timeout and 5-second polling interval. The previous synchronous assertion was racy — the envtest API server cache could still reflect a ConfigMap from a prior test's reconcile loop. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9f8e009 to
971e635
Compare
|
Thanks @mtulio , just squashed the two and pushed. |
|
/payload-job periodic-ci-openshift-hypershift-release-4.23-periodics-e2e-aws-ovn-conformance-ccm-techpreview |
|
@mtulio: trigger 0 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command |
|
/payload-job periodic-ci-openshift-hypershift-release-5.0-periodics-e2e-aws-ovn-conformance-techpreview |
|
@mtulio: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/ef6b3000-6e59-11f1-84f5-8fd4e61631a8-0 |
|
LGTM Feel free to drop hold label when you verify it on CI job results (including hypershift periodic). |
|
New changes are detected. LGTM label has been removed. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@openshift-tests/ccm-aws-tests/main.go`:
- Around line 141-142: The os.Setenv call for setting AWS_REGION is not checking
for error returns before returning the region value as success. Modify the code
to capture the error return value from os.Setenv when setting the AWS_REGION
environment variable, check if an error occurred, and handle it appropriately
(either by returning the error from the function or handling it in a way that
prevents reporting success when the environment variable was not actually set).
Apply this same fix to all other instances where os.Setenv is called without
error checking, including the occurrence around line 152.
- Around line 146-149: The call to common.GetRegionFromInfrastructure() on line
146 uses context.Background() which lacks a timeout, allowing the API call to
block indefinitely if the Infrastructure endpoint stalls and causing test suite
hangs. Replace context.Background() with a context that includes a reasonable
timeout (such as 30 seconds) using context.WithTimeout() to ensure the
Infrastructure API lookup completes or fails promptly without blocking test
initialization.
🪄 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: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: a04d4cfe-4a36-43a7-aa48-f42f7ddd37a7
📒 Files selected for processing (3)
openshift-tests/ccm-aws-tests/e2e/aws/helper.goopenshift-tests/ccm-aws-tests/e2e/common/helper.goopenshift-tests/ccm-aws-tests/main.go
412554f to
c2f6e08
Compare
|
/payload-job periodic-ci-openshift-hypershift-release-5.0-periodics-e2e-aws-ovn-conformance-techpreview |
|
@mfbonfigli: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/1764e290-6ef0-11f1-9674-502bea550e73-0 |
Updates the logic to set the AWS_REGION env var validating before if it is a valid region string. Additionally in case all paths fail also tries to extract it from the cluster.
c2f6e08 to
8dc4ed6
Compare
|
/payload-job periodic-ci-openshift-hypershift-release-5.0-periodics-e2e-aws-ovn-conformance-techpreview |
|
@mfbonfigli: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/ebc3c2e0-6f09-11f1-9c31-c4face463719-0 |
|
@mfbonfigli: 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. |
What
Updates the AWS CCM e2e tests module version to the latest version, including refreshing the vendored dependencies for the test binary.
Additionally fixes an unrelated unit test that was causing test failures by wrapping it in an Eventually statement.
Why
The purpose is to pull down the latest test changes which include new e2e tests for the BYO Security Groups feature for AWS Network Load Balancers. The feature has already been merged in upstream and downstream AWS CCM. Updating the test dependency will ensure these e2e tests will run in downstream constantly ensuring the feature works as expected.
Summary by CodeRabbit
Summary