-
Notifications
You must be signed in to change notification settings - Fork 70
Add E2E tests for Workloads/Job in the dashboard #259
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 significantly updates the end-to-end testing framework for the dashboard. It streamlines the test suite by removing outdated namespace-related tests and introduces new, focused tests to ensure the proper functioning and display of workload-related features, specifically the Job list. These changes are accompanied by necessary dependency additions and updates to facilitate the new testing capabilities.
Highlights
- E2E Test Suite Refactoring: Existing end-to-end tests for Namespace creation, deletion, and network error handling have been removed to streamline the test suite.
- New Workloads/Job E2E Tests: The
namespace-list.spec.ts
test file has been renamed tojob-list.spec.ts
and updated to verify the proper display of the Job list under the Workloads section of the dashboard. - Dependency Updates: The
@kubernetes/client-node
package has been added as a new dependency, along with various other dependency updates inpackage.json
andpnpm-lock.yaml
to support the new E2E test 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 an end-to-end test for the Job workload list in the dashboard. The changes involve removing old, unused namespace-related tests and creating a new test file for the job list. The new test navigates to the Workloads section, selects the Job tab, and verifies that the job list table is displayed.
My review focuses on improving the clarity and robustness of the new test. I've suggested renaming a misleading variable and adding a more specific assertion to ensure the correct table is being tested. These changes will enhance the maintainability and reliability of the test suite.
const statefulsetTab = page.locator('role=option[name="Job"]'); | ||
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 'Job' tab. This is misleading and could cause confusion for future maintenance. It should be renamed to jobTab
for clarity.
const statefulsetTab = page.locator('role=option[name="Job"]'); | |
await statefulsetTab.waitFor({ state: 'visible', timeout: 30000 }); | |
await statefulsetTab.click(); | |
// 验证选中状态 | |
await expect(statefulsetTab).toHaveAttribute('aria-selected', 'true'); | |
const jobTab = page.locator('role=option[name="Job"]'); | |
await jobTab.waitFor({ state: 'visible', timeout: 30000 }); | |
await jobTab.click(); | |
// 验证选中状态 | |
await expect(jobTab).toHaveAttribute('aria-selected', 'true'); |
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.
The current test only verifies that a table is visible, but it doesn't confirm that it's the correct table for Jobs. To make the test more robust, I suggest also checking for a specific column header, for example, '负载名称' (Workload Name).
const table = page.locator('table'); | |
await expect(table).toBeVisible({ timeout: 30000 }); | |
const table = page.locator('table'); | |
await expect(table).toBeVisible({ timeout: 30000 }); | |
// Also verify a column header to ensure it's the correct table | |
await expect(page.getByRole('columnheader', { name: '负载名称' })).toBeVisible(); |
Signed-off-by: SunsetB612 <[email protected]>
Signed-off-by: SunsetB612 <[email protected]>
Signed-off-by: SunsetB612 <[email protected]>
Signed-off-by: SunsetB612 <[email protected]>
Signed-off-by: SunsetB612 <[email protected]>
Signed-off-by: SunsetB612 <[email protected]>
No description provided.