Skip to content

Fix(e2e): add crd check#198

Merged
cheyang merged 15 commits intosgl-project:mainfrom
Syspretor:fix/e2e-failed
Mar 15, 2026
Merged

Fix(e2e): add crd check#198
cheyang merged 15 commits intosgl-project:mainfrom
Syspretor:fix/e2e-failed

Conversation

@Syspretor
Copy link
Collaborator

Ⅰ. Motivation

Ⅱ. Modifications

Ⅲ. Does this pull request fix one issue?

fixes #XXXX

Ⅳ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

Ⅴ. Describe how to verify it

VI. Special notes for reviews

Checklist

  • Format your code make fmt.
  • Add unit tests or integration tests.
  • Update the documentation related to the change.

@gemini-code-assist
Copy link

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves e2e test reliability and fixes race conditions in the RBG controller's status management. It adds a CRD verification step to the CI workflow, refactors debug dump functions, and fixes SSA (Server-Side Apply) field ownership conflicts between the RBG controller and the pod controller for status conditions.

Changes:

  • Replaces ginkgo.DeferCleanup with f.RegisterDebugFn in v1alpha2 e2e tests and adds comprehensive cleanup (resource deletion + pod wait) in AfterEach, with a CRD verification step in CI.
  • Fixes SSA race condition where the RBG controller could overwrite the pod controller's RestartInProgress condition by filtering conditions per field manager and including RoleStatuses/ObservedGeneration in both managers' apply configs.
  • Improves debug dump functions to correctly dispatch by workload type (Deployment, StatefulSet, LWS, RoleInstanceSet) instead of only checking leader-worker vs standalone pattern.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/e2e/framework/framework.go Adds RegisterDebugFn, resource cleanup in AfterEach, and pod deletion wait
test/e2e/testcase/v1alpha2/debug.go Switches workload-type dispatch to use role.Workload.String(), adds Deployment and RoleInstanceSet dump functions
test/e2e/framework/rbg_v2_expect.go Simplifies workloadTypeFromRoleV2 to use role.Workload.String()
internal/controller/workloads/rolebasedgroup_controller.go Filters RestartInProgress from RBG controller's SSA patch, adds readyConditionMissing trigger
internal/controller/workloads/pod_controller.go Adds ObservedGeneration and RoleStatuses to pod controller's apply configs, nil guard for ToRoleStatusApplyConfiguration
test/e2e/testcase/v1alpha2/revision.go Wraps generation check in gomega.Eventually, adds debug logging
.github/workflows/e2e-test.yml Adds CRD verification step, updates controller log label selector
Makefile Removes manifests generate fmt vet prerequisites from test-e2e target
pkg/reconciler/svc_reconciler_test.go Adds corev1 scheme registration
test/e2e/testcase/v1alpha2/*.go Migrates all v1alpha2 tests from DeferCleanup to RegisterDebugFn

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

fmt.Printf("[Deployment] Failed to get Deployment: %v\n", err)
} else {
fmt.Printf("[Deployment] Status: Replicas=%d, ReadyReplicas=%d, AvailableReplicas=%d, UpdatedReplicas=%d\n",
*deploy.Spec.Replicas, deploy.Status.ReadyReplicas, deploy.Status.AvailableReplicas, deploy.Status.UpdatedReplicas)
if err != nil {
return false
}
ginkgo.By(fmt.Sprintf("Got new RoleInstanceSet, generation: %d (expected: %d)", newRis.Generation, oldRis.Generation+2))
Copy link
Collaborator

@cheyang cheyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@cheyang cheyang merged commit 5573654 into sgl-project:main Mar 15, 2026
11 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants