-
Notifications
You must be signed in to change notification settings - Fork 182
add cypress coverage for manage columns behaviour in hardware conf table #2732
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
Open
Philip-Carneiro
wants to merge
3
commits into
kubeflow:main
Choose a base branch
from
Philip-Carneiro:test/manage-columns-cypress-coverage
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+184
−0
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
150 changes: 150 additions & 0 deletions
150
...s/ui/frontend/src/__tests__/cypress/cypress/tests/mocked/modelCatalog/manageColumns.cy.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,150 @@ | ||
| /* eslint-disable camelcase */ | ||
| import { modelCatalog } from '~/__tests__/cypress/cypress/pages/modelCatalog'; | ||
| import { mockModelRegistry } from '~/__mocks__/mockModelRegistry'; | ||
| import { | ||
| setupModelCatalogIntercepts, | ||
| interceptPerformanceArtifactsList, | ||
| interceptArtifactsList, | ||
| type ModelCatalogInterceptOptions, | ||
| } from '~/__tests__/cypress/cypress/support/interceptHelpers/modelCatalog'; | ||
| import { NBSP } from '~/__tests__/cypress/cypress/support/constants'; | ||
| import { HARDWARE_CONFIG_COLUMNS_STORAGE_KEY as STORAGE_KEY } from '~/app/pages/modelCatalog/components/HardwareConfigurationTableColumns'; | ||
|
|
||
| const initIntercepts = (options: Partial<ModelCatalogInterceptOptions> = {}) => { | ||
| const resolvedOptions = { | ||
| useValidatedModel: true, | ||
| includePerformanceArtifacts: true, | ||
| ...options, | ||
| }; | ||
|
|
||
| setupModelCatalogIntercepts(resolvedOptions); | ||
|
|
||
| if (resolvedOptions.includePerformanceArtifacts) { | ||
| interceptArtifactsList(); | ||
| interceptPerformanceArtifactsList(); | ||
| } | ||
| }; | ||
|
|
||
| const navigateToPerformanceInsights = () => { | ||
| modelCatalog.visit(); | ||
| modelCatalog.findLoadingState().should('not.exist'); | ||
| modelCatalog.findModelCatalogDetailLink().first().click(); | ||
| modelCatalog.clickPerformanceInsightsTab(); | ||
| }; | ||
|
|
||
| const navigateWithPerformanceView = () => { | ||
| modelCatalog.visit(); | ||
| modelCatalog.findLoadingState().should('not.exist'); | ||
| modelCatalog.togglePerformanceView(); | ||
| modelCatalog.findModelCatalogDetailLink().first().click(); | ||
| modelCatalog.clickPerformanceInsightsTab(); | ||
| }; | ||
|
|
||
| describe('Manage Columns Modal', () => { | ||
| beforeEach(() => { | ||
| cy.intercept('GET', '/model-registry/api/v1/model_registry*', [ | ||
| mockModelRegistry({ name: 'modelregistry-sample' }), | ||
| ]).as('getModelRegistries'); | ||
|
|
||
| cy.clearLocalStorage(STORAGE_KEY); | ||
| initIntercepts(); | ||
| }); | ||
|
|
||
| describe('Smoke Test', () => { | ||
| it('should open the manage columns modal and display its controls', () => { | ||
| navigateToPerformanceInsights(); | ||
|
|
||
| modelCatalog.findManageColumnsButton().should('be.visible'); | ||
| modelCatalog.openManageColumnsModal(); | ||
|
|
||
| modelCatalog.findManageColumnsSearch().should('be.visible'); | ||
| modelCatalog.findManageColumnsUpdateButton().should('be.visible'); | ||
| modelCatalog.findManageColumnsCancelButton().should('be.visible'); | ||
| modelCatalog.findManageColumnsRestoreDefaults().should('be.visible'); | ||
| }); | ||
| }); | ||
|
|
||
| describe('Sticky Columns Exclusion', () => { | ||
| it('should not show sticky columns in the modal', () => { | ||
| navigateToPerformanceInsights(); | ||
| modelCatalog.openManageColumnsModal(); | ||
|
|
||
| modelCatalog.findManageColumnsModal().should('not.contain.text', 'Hardware configuration'); | ||
| modelCatalog.findManageColumnsModal().should('not.contain.text', 'Workload type'); | ||
| }); | ||
|
|
||
| it('should always show sticky columns in the table after toggling other columns off', () => { | ||
| navigateToPerformanceInsights(); | ||
|
|
||
| modelCatalog.openManageColumnsModal(); | ||
| modelCatalog.findManageColumnCheckbox('Replicas').uncheck(); | ||
| modelCatalog.findManageColumnCheckbox('vLLM Version').uncheck(); | ||
| modelCatalog.findManageColumnsUpdateButton().click(); | ||
|
|
||
| modelCatalog.findHardwareConfigurationTableHeaders().should('not.contain.text', 'Replicas'); | ||
| modelCatalog | ||
| .findHardwareConfigurationTableHeaders() | ||
| .should('not.contain.text', 'vLLM Version'); | ||
|
|
||
| modelCatalog | ||
| .findHardwareConfigurationTableHeaders() | ||
| .should('contain.text', 'Hardware configuration'); | ||
| modelCatalog.findHardwareConfigurationTableHeaders().should('contain.text', 'Workload type'); | ||
| }); | ||
| }); | ||
|
|
||
| describe('Latency Filter Interaction with Column Visibility', () => { | ||
| it('should update visible columns when latency filter is applied', () => { | ||
| navigateWithPerformanceView(); | ||
|
|
||
| modelCatalog.openLatencyFilter(); | ||
| modelCatalog.selectLatencyMetric('E2E'); | ||
| modelCatalog.selectLatencyPercentile('Mean'); | ||
| modelCatalog.clickApplyFilter(); | ||
|
|
||
| modelCatalog | ||
| .findHardwareConfigurationTableHeaders() | ||
| .should('contain.text', `E2E${NBSP}Latency Mean`); | ||
| modelCatalog.findHardwareConfigurationTableHeaders().should('contain.text', `TPS${NBSP}Mean`); | ||
|
|
||
| modelCatalog.findHardwareConfigurationTableHeaders().should('not.contain.text', 'TTFT'); | ||
| modelCatalog.findHardwareConfigurationTableHeaders().should('not.contain.text', 'ITL'); | ||
| }); | ||
|
|
||
| it('should reflect latency filter changes in the manage columns modal state', () => { | ||
| navigateWithPerformanceView(); | ||
|
|
||
| modelCatalog.openLatencyFilter(); | ||
| modelCatalog.selectLatencyMetric('ITL'); | ||
| modelCatalog.selectLatencyPercentile('P95'); | ||
| modelCatalog.clickApplyFilter(); | ||
|
|
||
| modelCatalog | ||
| .findHardwareConfigurationTableHeaders() | ||
| .should('contain.text', `ITL${NBSP}Latency P95`); | ||
| modelCatalog.findHardwareConfigurationTableHeaders().should('contain.text', `TPS${NBSP}P95`); | ||
|
|
||
| modelCatalog.openManageColumnsModal(); | ||
|
|
||
| modelCatalog.findManageColumnCheckbox(`ITL${NBSP}Latency P95`).should('be.checked'); | ||
| modelCatalog.findManageColumnCheckbox(`TPS${NBSP}P95`).should('be.checked'); | ||
| }); | ||
|
|
||
| it('should keep non-latency columns unchanged when latency filter updates column visibility', () => { | ||
| navigateWithPerformanceView(); | ||
|
|
||
| modelCatalog.findHardwareConfigurationTableHeaders().should('contain.text', 'Replicas'); | ||
|
|
||
| modelCatalog.openLatencyFilter(); | ||
| modelCatalog.selectLatencyMetric('E2E'); | ||
| modelCatalog.selectLatencyPercentile('P99'); | ||
| modelCatalog.clickApplyFilter(); | ||
|
|
||
| modelCatalog.findHardwareConfigurationTableHeaders().should('contain.text', 'Replicas'); | ||
| modelCatalog | ||
| .findHardwareConfigurationTableHeaders() | ||
| .should('contain.text', 'Hardware configuration'); | ||
| modelCatalog.findHardwareConfigurationTableHeaders().should('contain.text', 'Workload type'); | ||
| }); | ||
| }); | ||
| }); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.