generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Unify the UT (Unit Testing) Framework for the Fluid Project, Including:*
- Replace
gohookwithgomonkeyto implement a more modern and compatible monkey-patching solution. - Promote
ginkgoandgomegato gradually replacetestify, enabling a more structured BDD-style testing approach.
Why This Feature Is Needed:
gohooklacks active maintenance and has insufficient compatibility with newer Go versions, posing high upgrade risks.gomonkeyhas a more active community, richer documentation, and examples. Recommendation: Use monkey-patching only when interface mocking is infeasible; ensure strict control over patch/restore timing and concurrency safety.testify/assertassertions are simple but inadequate for expressing complex test structures. TheginkgoBDD framework provides comprehensive lifecycle hooks and more readable test case structures, making it suitable for standardizing Fluid’s testing practices and CI protocols.
Proposed Implementation Plan:
- Audit repository usage of
gohookandtestify. - Conduct pilot migrations (PoC) of
gomonkeyandginkgoin core components/typical modules to validate compatibility and CI performance. - Implementation reference: See PR #5212 for practical migration examples.
- Migrate incrementally by package; add patch/restore safety checks in CI, prohibiting concurrent monkey-patching tests.
- Develop migration guidelines and best practices documentation; organize team-wide training and discussions.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request