Skip to content

Conversation

@7h3-3mp7y-m4n
Copy link
Contributor

What type of PR is this?

Adds output-verification test cases for DaemonSet under third-party resource customizations, covering

  • InterpretHealth

What this PR does / why we need it:

Improves test coverage for Kruise DaemonSet interpreter logic

Which issue(s) this PR fixes:

Fixes #6952

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@karmada-bot karmada-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 5, 2026
@karmada-bot karmada-bot requested review from Poor12 and yike21 January 5, 2026 13:42
@karmada-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign yike21 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gemini-code-assist
Copy link

Summary of Changes

Hello @7h3-3mp7y-m4n, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on bolstering the robustness of DaemonSet health interpretation within the system. By expanding the test suite with new and detailed scenarios, it ensures that the system can accurately identify and report various unhealthy states of DaemonSets. This enhancement is crucial for maintaining the reliability and correctness of resource management, particularly for DaemonSets managed through third-party resource customizations.

Highlights

  • Enhanced DaemonSet Health Interpretation Tests: Added comprehensive output-verification test cases for the InterpretHealth functionality of DaemonSets under third-party resource customizations.
  • New Unhealthy State Scenarios: Introduced specific test scenarios to verify unhealthy states of DaemonSets, including cases where observedGeneration does not match generation, when numberAvailable is less than updatedNumberScheduled, and when updatedNumberScheduled is less than desiredNumberScheduled.
  • Improved Test Coverage: Significantly improved the overall test coverage for the Kruise DaemonSet interpreter logic, addressing and fixing issue [Umbrella] Enhance third-party resource interpreter tests with output verification #6952.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 5, 2026
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request enhances the test coverage for the Kruise DaemonSet resource interpreter by adding several test cases for health interpretation. The new tests cover scenarios where the DaemonSet is considered unhealthy, such as generation mismatch, not all pods being updated, and not all updated pods being available. The additions are logical and correctly reflect the health interpretation rules. I have a couple of minor suggestions regarding code style in the test data file to improve maintainability.

status:
observedGeneration: 2
desiredNumberScheduled: 5
updatedNumberScheduled: 3

Choose a reason for hiding this comment

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

medium

There is trailing whitespace on this line. While it may not affect YAML parsing in this context, it's considered a good practice to remove it to maintain code cleanliness and prevent potential issues with tools that are sensitive to whitespace.

    updatedNumberScheduled: 3

numberAvailable: 3
operation: InterpretHealth
output:
healthy: false

Choose a reason for hiding this comment

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

medium

The file is missing a newline character at the end. It's a standard convention (part of the POSIX standard for text files) to end files with a newline. This ensures file integrity and prevents issues with some command-line tools that process text files.

  healthy: false

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.55%. Comparing base (0eee182) to head (78f3fec).
⚠️ Report is 25 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7084      +/-   ##
==========================================
- Coverage   46.56%   46.55%   -0.02%     
==========================================
  Files         700      700              
  Lines       48084    48091       +7     
==========================================
- Hits        22392    22390       -2     
- Misses      24010    24019       +9     
  Partials     1682     1682              
Flag Coverage Δ
unittests 46.55% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Umbrella] Enhance third-party resource interpreter tests with output verification

3 participants