Skip to content
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

Test Plan: Enhance Karmada controller-manager and schedule testing coverage (LFX 2024 TERM 3) #5470

Open
anujagrawal699 opened this issue Sep 2, 2024 · 3 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@anujagrawal699
Copy link
Contributor

anujagrawal699 commented Sep 2, 2024

Test Plan

Objective:
To improve the unit test coverage for the specified directories in the Karmada repository.

Plan:

  1. Project Understanding

    • Understand the functionality and interdependencies within the karmada-controller-manager and karmada-scheduler components.
    • Document the critical code paths that are essential for the core functionality of each module.
    • Analyze the current test coverage reports and existing test cases.
  2. Test Coverage Enhancement Strategy

    • Target Directories:

      • pkg/controllers (Currently 22.1%) (Estimated completion for the package 25 September)
      • pkg/detector (Currently 19.58%)
      • pkg/scheduler (Currently 52.36%)
      • pkg/descheduler (Currently 65.37%)
      • pkg/util (Currently 59.35%)
      • pkg/estimator (Currently 42.46%)
      • pkg/dependenciesdistributor (Currently 51.36%)
      • pkg/resourceinterpreter (Currently 46.22%)
    • Critical Logic Testing:

      • Focus on core business logic and test the functions needed without increasing the maintenance cost.
    • Testing Methodologies:

      • Unit Testing: For individual functions, methods, and classes focusing on isolated code units.
      • Table-Driven Tests: Implement table-driven tests where possible to efficiently test multiple scenarios using test cases.
  3. Test Implementation

    • Directory-by-Directory Implementation:

      • Begin with the most critical directories, i.e., pkg/controllers and the one with the least coverage, i.e., pkg/detector.
      • Move to the next directory in the suggested order after completing testing for each directory.
    • Continuous Improvement:

      • Regularly review new tests to ensure they are meaningful, efficient, and cover the intended scenarios.
      • Refactor old code and tests to remove redundancy and improve maintainability.
  4. Evaluation

    • Perform a mid-point review of the coverage reports to ensure that the UT coverage is on track to increase by more than 25%.
    • Optimize any tests that might be redundant or overly complex to maintain test efficiency.
  5. Expected Outcomes

    • Increased Coverage:

      • Achieve a significant increase in UT coverage, around 60% coverage overall.
    • Improved Code Quality:

      • Enhance the quality and maintainability of the Karmada codebase, reducing the likelihood of defects.

Mentors: @XiShanYongYe-Chang , @zhzhuang-zju
Mentee: @anujagrawal699

PR Tracking

Overall Coverage Improved by this issue till date: +7.5%

Legend:

  • ⏳ - Under Review
  • ✅ - Merged
Status Date Directory Old Coverage New Coverage Overall Coverage Increase PR
Aug 6 pkg/controllers/context 42.3% 100% 0.07% #5310
Aug 9 pkg/util/eventfilter 26.7% 100% 0.05% #5338
Aug 13 pkg/descheduler 13.75% 85.5% 0.79% #5364
Aug 22 pkg/util/fedinformer 2% 83.84% 1.25% #5366
Aug 14 pkg/controllers/namespace 0% 41.7% 0.53% #5368
Aug 17 pkg/servicenameresolutiondetector 0% 80% 0.92% #5408
Aug 20 operator/pkg/controller/context 0% 48.38% 0.49% #5420
Aug 24 examples/customresourceinterpreter/webhook 0% 42.5% 0.24% #5433
Aug 27 cmd/descheduler 0% 34% 0.13% #5445
Sep 1 cmd/scheduler 0% 34% 0.58% #5459
Sep 5 pkg/controllers/cronfederatedhpa 0% 27.8% 0.21% #5481
Sep 7 pkg/controllers/deploymentreplicassyncer 0% 65.3% 0.11% #5493
Sep 11 pkg/controllers/federatedhpa 1.79% 49.62% 1.25% #5528
Sep 12 pkg/controllers/federatedresourcequota 0% 51.3% 0.17% #5535
Sep 13 pkg/controllers/gracefuleviction 35.90% 76.7% 0.13% #5543
Sep 14 pkg/controllers/hpascaletargetmarker 0% 79.8% 0.21% #5553
Sep 18 pkg/controllers/mcs 0% 44.4% 0.50% #5566
@anujagrawal699 anujagrawal699 added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 2, 2024
@XiShanYongYe-Chang
Copy link
Member

ref #5235

@XiShanYongYe-Chang
Copy link
Member

Thanks @anujagrawal699
/assinn @anujagrawal699

@anujagrawal699
Copy link
Contributor Author

Thanks @anujagrawal699 /assinn @anujagrawal699

Typo in assign. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
Status: No status
Development

No branches or pull requests

2 participants