Skip to content

Conversation

SunsetB612
Copy link
Contributor

No description provided.

@karmada-bot
Copy link
Collaborator

[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 warjiang for approval. For more information see the Kubernetes Code Review Process.

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

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

@karmada-bot karmada-bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Sep 12, 2025
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.

Summary of Changes

Hello @SunsetB612, 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 refactoring and updating the End-to-End (E2E) test suite for the dashboard. It removes outdated namespace-related tests and repurposes an existing namespace list test to cover cronjob listing functionality. Additionally, it introduces a new dependency, @kubernetes/client-node, which suggests an expansion of the dashboard's capabilities or testing approach. While the PR title mentions adding E2E tests for member clusters, the current changes primarily involve cleanup and re-scoping of existing tests rather than the introduction of new member cluster-specific tests.

Highlights

  • E2E Test Suite Refactoring: Several existing E2E tests related to namespace management (creation, deletion, network error handling) have been removed, streamlining the test suite.
  • Namespace List Test Repurposed to CronJob List Test: The E2E test previously responsible for listing namespaces has been renamed and updated to validate the display and functionality of the CronJob list in the dashboard.
  • New Dependency Added: @kubernetes/client-node: The @kubernetes/client-node package has been added as a dependency, indicating potential future enhancements or more direct Kubernetes API interactions within the dashboard or its testing infrastructure.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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.

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 adds a new end-to-end test for the CronJob list page and removes several E2E tests related to namespaces. While adding new tests is great, the removal of existing tests for namespace creation, deletion, and network error handling is concerning. Please clarify if this functionality is now covered by other tests.

The PR title, "Add E2E tests for Member Clusters in the dashboard," does not seem to accurately reflect the changes. A more descriptive title would be helpful.

I've added a few review comments focusing on improving the new test's clarity and robustness, and a high-severity comment regarding a new dependency in package.json that might be better suited as a development dependency to avoid bloating the production bundle.

"@karmada/i18n-tool": "workspace:*",
"@karmada/terminal": "workspace:*",
"@karmada/utils": "workspace:*",
"@kubernetes/client-node": "^1.3.0",

Choose a reason for hiding this comment

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

high

The @kubernetes/client-node package has been added to dependencies. This package is typically used for backend services. If it's only used for development purposes, such as in E2E tests for test setup, it should be moved to devDependencies. This will prevent it from being included in the production frontend bundle, which would unnecessarily increase the application's size. Please clarify its usage and move it if it's not a runtime dependency for the client application.

*/

// apps/dashboard/e2e/namespace-list.spec.ts
// apps/dashboard/e2e/cronjob-list.spec.ts

Choose a reason for hiding this comment

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

medium

The file path in this comment is incorrect. It should be updated to match the actual file path for better maintainability.

Suggested change
// apps/dashboard/e2e/cronjob-list.spec.ts
// apps/dashboard/e2e/workload/cronjob/cronjob-list.spec.ts

Comment on lines 41 to 46
const statefulsetTab = page.locator('role=option[name="Cronjob"]');
await statefulsetTab.waitFor({ state: 'visible', timeout: 30000 });
await statefulsetTab.click();

// 验证选中状态
await expect(statefulsetTab).toHaveAttribute('aria-selected', 'true');

Choose a reason for hiding this comment

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

medium

The variable statefulsetTab is used to locate and interact with the "Cronjob" tab, which is misleading. For clarity and maintainability, it should be renamed to cronjobTab. Additionally, the comment on line 45 is in Chinese; please use English for consistency with the rest of the codebase.

Suggested change
const statefulsetTab = page.locator('role=option[name="Cronjob"]');
await statefulsetTab.waitFor({ state: 'visible', timeout: 30000 });
await statefulsetTab.click();
// 验证选中状态
await expect(statefulsetTab).toHaveAttribute('aria-selected', 'true');
const cronjobTab = page.locator('role=option[name="Cronjob"]');
await cronjobTab.waitFor({ state: 'visible', timeout: 30000 });
await cronjobTab.click();
// Verify selected state
await expect(cronjobTab).toHaveAttribute('aria-selected', 'true');

await expect(statefulsetTab).toHaveAttribute('aria-selected', 'true');


// 验证 StatefulSet 列表表格可见

Choose a reason for hiding this comment

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

medium

This comment is in Chinese and incorrectly refers to StatefulSet. Please update it to English and refer to CronJob to accurately reflect the test's context.

Suggested change
// 验证 StatefulSet 列表表格可见
// Verify that the CronJob list table is visible

Comment on lines 50 to 43
const table = page.locator('table');
await expect(table).toBeVisible({ timeout: 30000 });

Choose a reason for hiding this comment

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

medium

This test only verifies that a <table> element is visible. To make the test more robust, consider adding an assertion to check for the presence of expected content, such as table headers (e.g., 'Name', 'Namespace'). This would help ensure that the table is not just rendered but also correctly populated.

@SunsetB612
Copy link
Contributor Author

/hold

@karmada-bot karmada-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 12, 2025
@SunsetB612 SunsetB612 force-pushed the add-e2e-memberclusters branch from cb9b1b9 to d77203a Compare September 20, 2025 05:35
@karmada-bot karmada-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 20, 2025
@SunsetB612 SunsetB612 force-pushed the add-e2e-memberclusters branch from d77203a to b2c4512 Compare September 20, 2025 08:44
@karmada-bot karmada-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 20, 2025
@SunsetB612 SunsetB612 force-pushed the add-e2e-memberclusters branch from b2c4512 to 4840ff0 Compare September 20, 2025 09:30
@karmada-bot karmada-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 20, 2025
@SunsetB612 SunsetB612 force-pushed the add-e2e-memberclusters branch from 4840ff0 to db3579a Compare September 20, 2025 11:01
@karmada-bot karmada-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 20, 2025
@SunsetB612 SunsetB612 force-pushed the add-e2e-memberclusters branch from db3579a to 05c40cb Compare September 20, 2025 11:05
@SunsetB612
Copy link
Contributor Author

/unhold

@karmada-bot karmada-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants