-
Notifications
You must be signed in to change notification settings - Fork 70
Add E2E tests for Member Clusters in the dashboard #270
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
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
There was a problem hiding this 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
-
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. ↩
There was a problem hiding this 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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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 列表表格可见 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const table = page.locator('table'); | ||
await expect(table).toBeVisible({ timeout: 30000 }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
/hold |
cb9b1b9
to
d77203a
Compare
d77203a
to
b2c4512
Compare
b2c4512
to
4840ff0
Compare
4840ff0
to
db3579a
Compare
Signed-off-by: SunsetB612 <[email protected]>
db3579a
to
05c40cb
Compare
/unhold |
No description provided.