Skip to content

Conversation

SunsetB612
Copy link
Contributor

No description provided.

Signed-off-by: SunsetB612 <[email protected]>
@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 kevin-wangzefeng 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 primarily adjusts the scope and underlying infrastructure of the dashboard's End-to-End test suite. It removes several E2E tests previously covering Namespace operations and refactors an existing Namespace list test to now validate the display of Cronjob lists. Additionally, the @kubernetes/client-node library has been integrated, which suggests an enhancement in how E2E tests might interact with the Kubernetes API or a broader architectural change within the dashboard. Please note that the changes in this PR do not align with the title's stated goal of adding E2E tests for Services/Service.

Highlights

  • E2E Test Scope Adjustment: Existing End-to-End (E2E) tests related to Namespace creation, deletion, and network error handling have been removed.
  • Cronjob List Test Introduction: A previous Namespace list E2E test has been refactored and renamed to specifically test the display of the Cronjob list within the dashboard.
  • Kubernetes Client Integration: The @kubernetes/client-node dependency has been added, along with its transitive dependencies, indicating preparation for direct Kubernetes API interactions, potentially for future E2E test setup/teardown or dashboard functionality.
  • PR Title Discrepancy: It is important to note that despite the PR title "Add E2E tests for Services/Service in the dashboard", the actual changes involve the removal and refactoring of existing E2E tests, and dependency updates, rather than the explicit addition of new E2E tests for Services/Service.
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 an E2E test for the CronJob list page, which is a good addition. However, there are a few points to consider:

  1. The PR title "Add E2E tests for Services/Service in the dashboard" is misleading, as the new test is for CronJobs, not Services. Please update the title to accurately reflect the changes.
  2. This PR also removes three E2E tests for namespaces (namespace-create, namespace-delete, namespace-network-error). If this is intentional, it would be helpful to provide a reason in the PR description.
  3. The new CronJob test could be improved by making the assertions more specific, as detailed in the review comments.

Overall, the changes are a step in the right direction for improving test coverage, but the context and clarity could be improved.

Comment on lines 40 to 46
// 点击可见的 Statefulset tab
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 comment and variable name in this section are misleading. They refer to 'Statefulset' while the test is for 'Cronjob'. This can cause confusion for future developers maintaining this code. Please update them to reflect that this test is for CronJobs.

Suggested change
// 点击可见的 Statefulset tab
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');
// 点击可见的 Cronjob tab
const cronjobTab = page.locator('role=option[name="Cronjob"]');
await cronjobTab.waitFor({ state: 'visible', timeout: 30000 });
await cronjobTab.click();
// 验证选中状态
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 misleading as it refers to 'StatefulSet' while the test is for 'Cronjob'.

Suggested change
// 验证 StatefulSet 列表表格可见
// 验证 Cronjob 列表表格可见

Comment on lines 50 to 51
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 is visible, but it doesn't check for any specific content within the table, such as headers or rows. This makes the test less effective as it doesn't confirm that the correct data (cronjobs) is being displayed.

Consider adding assertions to check for expected table headers (e.g., 'Name', 'Namespace', 'Schedule'). For example:

await expect(page.locator('table th:has-text("Name")')).toBeVisible();
await expect(page.locator('table th:has-text("Schedule")')).toBeVisible();

@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-service-service branch from b145cee to da90240 Compare September 13, 2025 08:20
@karmada-bot karmada-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 13, 2025
@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 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants