-
Notifications
You must be signed in to change notification settings - Fork 70
Add E2E tests for Services/Service in the dashboard #262
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
Signed-off-by: SunsetB612 <[email protected]>
[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 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
-
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 an E2E test for the CronJob list page, which is a good addition. However, there are a few points to consider:
- 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.
- 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. - 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.
// 点击可见的 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'); |
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 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.
// 点击可见的 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 列表表格可见 |
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 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();
/hold |
Signed-off-by: SunsetB612 <[email protected]>
Signed-off-by: SunsetB612 <[email protected]>
Signed-off-by: SunsetB612 <[email protected]>
b145cee
to
da90240
Compare
Signed-off-by: SunsetB612 <[email protected]>
Signed-off-by: SunsetB612 <[email protected]>
/unhold |
No description provided.