Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: automatic mode |
WalkthroughThis pull request adds a new end-to-end test suite validating the ChangesOIDC Feature Gate Test Suite
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 12 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (12 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: gangwgr 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.
🧹 Nitpick comments (2)
test/extended/authentication/external_oidc_claims_sourcing.go (2)
125-139: ⚡ Quick winHealth check passes vacuously if conditions are missing.
The loop only asserts
Available/Degradedwhen those condition types are present inStatus.Conditions. If either condition is absent (e.g., the operator hasn't published it yet), the test silently passes without verifying health. Consider asserting that both conditions were actually observed.♻️ Proposed change
+ var sawAvailable, sawDegraded bool for _, cond := range kas.Status.Conditions { switch cond.Type { case "Available": + sawAvailable = true o.Expect(cond.Status).To(o.Equal(operatorv1.ConditionTrue), "kube-apiserver operator should be Available") case "Degraded": + sawDegraded = true o.Expect(cond.Status).To(o.Equal(operatorv1.ConditionFalse), "kube-apiserver operator should not be Degraded") } } + o.Expect(sawAvailable).To(o.BeTrue(), "kube-apiserver operator should report an Available condition") + o.Expect(sawDegraded).To(o.BeTrue(), "kube-apiserver operator should report a Degraded condition")🤖 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/extended/authentication/external_oidc_claims_sourcing.go` around lines 125 - 139, The health-check loop over kas.Status.Conditions can pass vacuously if the "Available" or "Degraded" conditions are missing; update the test in the It block that fetches kas (variable kas from oc.AdminOperatorClient().OperatorV1().KubeAPIServers().Get) to track whether "Available" and "Degraded" were seen (e.g., sawAvailable, sawDegraded) while iterating kas.Status.Conditions, keep the existing expectations for Available == operatorv1.ConditionTrue and Degraded == operatorv1.ConditionFalse, and after the loop add explicit assertions that both sawAvailable and sawDegraded are true so the test fails if either condition is absent.
27-32: 💤 Low valueFix misplaced
defer g.GinkgoRecover()and tighten operator health assertions
defer g.GinkgoRecover()is placed in the top-levelDescribecontainer body, so it doesn’t protect running specs; move/remove it (only needed in goroutines).♻️ Proposed change
var _ = g.Describe("[sig-auth][Suite:openshift/auth/external-oidc][Serial][Slow][Disruptive]", g.Ordered, func() {defer g.GinkgoRecover()
oc := exutil.NewCLIWithoutNamespace("oidc-claims-sourcing-e2e")</details> - “should keep the kube-apiserver operator healthy” only asserts when it sees `Available`/`Degraded` condition types in `kas.Status.Conditions`; if those conditions are missing, the spec can pass without checking health—add explicit expectations that both condition types are present (and asserted) before finishing. <details> <summary>🤖 Prompt for AI Agents</summary>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/extended/authentication/external_oidc_claims_sourcing.goaround lines
27 - 32, Move the misplaced defer g.GinkgoRecover() out of the top-level
g.Describe body (remove it there and only use defer g.GinkgoRecover() inside any
goroutines or helper functions that spawn goroutines) so it actually protects
goroutines rather than the Describe registration; then update the
health-checking spec that inspects kas.Status.Conditions (the "should keep the
kube-apiserver operator healthy" check) to explicitly assert that both condition
types "Available" and "Degraded" are present in kas.Status.Conditions before
asserting their Status values—add expectations that the condition entries exist
(and fail the test if missing) and only then check their .Status values to
tighten the operator health assertions.</details> </blockquote></details> </blockquote></details> <details> <summary>🤖 Prompt for all review comments with AI agents</summary>Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.Nitpick comments:
In@test/extended/authentication/external_oidc_claims_sourcing.go:
- Around line 125-139: The health-check loop over kas.Status.Conditions can pass
vacuously if the "Available" or "Degraded" conditions are missing; update the
test in the It block that fetches kas (variable kas from
oc.AdminOperatorClient().OperatorV1().KubeAPIServers().Get) to track whether
"Available" and "Degraded" were seen (e.g., sawAvailable, sawDegraded) while
iterating kas.Status.Conditions, keep the existing expectations for Available ==
operatorv1.ConditionTrue and Degraded == operatorv1.ConditionFalse, and after
the loop add explicit assertions that both sawAvailable and sawDegraded are true
so the test fails if either condition is absent.- Around line 27-32: Move the misplaced defer g.GinkgoRecover() out of the
top-level g.Describe body (remove it there and only use defer g.GinkgoRecover()
inside any goroutines or helper functions that spawn goroutines) so it actually
protects goroutines rather than the Describe registration; then update the
health-checking spec that inspects kas.Status.Conditions (the "should keep the
kube-apiserver operator healthy" check) to explicitly assert that both condition
types "Available" and "Degraded" are present in kas.Status.Conditions before
asserting their Status values—add expectations that the condition entries exist
(and fail the test if missing) and only then check their .Status values to
tighten the operator health assertions.</details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Repository YAML (base), Central YAML (inherited) **Review profile**: CHILL **Plan**: Enterprise **Run ID**: `6da88fe8-744f-43d6-91c1-d04a4a420837` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 76ed5a820c471faf71cdf93ec06faebff542bf20 and 246903274dd6b26fcc6c3898ab17543b14145d0e. </details> <details> <summary>📒 Files selected for processing (1)</summary> * `test/extended/authentication/external_oidc_claims_sourcing.go` </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
|
@gangwgr: 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 by CodeRabbit