Skip to content

Commit

Permalink
Added a further exclusion for Manifest checker, updated cluster stora…
Browse files Browse the repository at this point in the history
…ge to capture bug in step and fixed clusterSettings test which was using inaccurate logic
  • Loading branch information
antowaddle committed Dec 18, 2024
1 parent bca2ef3 commit 6005b3e
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ excludedSubstrings:
- localhost
- console-openshift-console.apps.test-cluster.example.com/
- console-openshift-console.apps.test-cluster.example.com
- repo.anaconda.cloud/repo/t/$
- repo.anaconda.cloud/repo/t/$
- figma.com/figma/ns
- scikit-learn.org/stable/getting_started.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,21 @@ describe('Regular Users can make use of the Storage Classes in the Cluster Stora
// TODO: This test is failing due to https://issues.redhat.com/browse/RHOAIENG-16609

it('If all SC are disabled except one, the SC dropdown should be disabled', () => {
// Authentication and navigation
cy.visitWithLogin('/projects', LDAP_CONTRIBUTOR_USER);
// Open the project
cy.step(`Navigate to the Project list tab and search for ${dspName}`,);
projectListPage.filterProjectByName(dspName);
projectListPage.findProjectLink(dspName).click();
cy.step('Navigate to the Cluster Storage tab and disable all non-default storage classes');
// Go to cluster storage tab
projectDetails.findSectionTab('cluster-storages').click();
// Disable all non-default storage classes
disableNonDefaultStorageClasses().then(() => {
// Open the Create cluster storage Modal
findAddClusterStorageButton().click();

cy.step('Checking that Storage Classes Dropdown is disabled - 🐛 RHOAIENG-16609 will fail this test in RHOAI');
// Check that the SC Dropdown is disabled
addClusterStorageModal.findStorageClassSelect().should('be.disabled');
});
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/__tests__/cypress/cypress/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ export type NotebookController = {
export type DashboardConfig = {
dashboardConfig: {
disableModelServing: boolean;
disableModelMesh: boolean;
disableKServe: boolean;
};
notebookController: NotebookController;
[key: string]: unknown;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,54 @@ import {
import type { DashboardConfig, NotebookControllerConfig } from '~/__tests__/cypress/cypress/types';

/**
* Validates the Model Serving Platform checkboxes display in the Cluster Settings.
* @param dashboardConfig The Model Serving Platform configuration object.
* Validates the visibility and state of Model Serving Platform checkboxes
* in the Cluster Settings based on the provided dashboard configuration.
*
* This function checks whether the Model Serving feature is enabled or disabled,
* and subsequently verifies the state of the Multi-Platform and Single-Platform
* checkboxes based on their respective enable/disable flags.
*
* - If Model Serving is disabled, both checkboxes should not be visible.
* - If Model Serving is enabled:
* - The Multi-Platform Checkbox will be checked if Model Mesh is enabled;
* otherwise, it will not be checked.
* - The Single-Platform Checkbox will be checked if KServe is enabled;
* otherwise, it will not be checked.
*
* @param dashboardConfig The Model Serving Platform configuration object containing
* settings related to model serving, model mesh, and KServe.
*/
export const validateModelServingPlatforms = (dashboardConfig: DashboardConfig): void => {
const isModelServingEnabled = dashboardConfig.dashboardConfig.disableModelServing;
cy.log(`Value of isModelServingDisabled: ${String(isModelServingEnabled)}`);
const isModelMeshEnabled = dashboardConfig.dashboardConfig.disableModelMesh;
const isKServeEnabled = dashboardConfig.dashboardConfig.disableKServe;

cy.log(`Value of isModelServingEnabled: ${String(isModelServingEnabled)}`);
cy.log(`Value of isModelMeshEnabled: ${String(isModelMeshEnabled)}`);
cy.log(`Value of isKServeEnabled: ${String(isKServeEnabled)}`);

if (isModelServingEnabled) {
modelServingSettings.findSinglePlatformCheckbox().should('not.exist');
modelServingSettings.findMultiPlatformCheckbox().should('not.exist');
cy.log('Model Serving is disabled, checkboxes should not be visible');
} else {
modelServingSettings.findSinglePlatformCheckbox().should('be.checked');
modelServingSettings.findMultiPlatformCheckbox().should('be.checked');
cy.log('Model Serving is enabled, checkboxes should be checked');
// Validate Multi-Platform Checkbox based on disableModelMesh
if (isModelMeshEnabled) {
modelServingSettings.findMultiPlatformCheckbox().should('not.be.checked');
cy.log('Multi-Platform Checkbox is disabled, it should not be checked');
} else {
modelServingSettings.findMultiPlatformCheckbox().should('be.checked');
cy.log('Multi-Platform Checkbox is enabled, it should be checked');
}

// Validate Single-Platform Checkbox based on disableKServe
if (isKServeEnabled) {
modelServingSettings.findSinglePlatformCheckbox().should('not.be.checked');
cy.log('Single-Platform Checkbox is disabled, it should not be checked');
} else {
modelServingSettings.findSinglePlatformCheckbox().should('be.checked');
cy.log('Single-Platform Checkbox is enabled, it should be checked');
}
}
};

Expand Down

0 comments on commit 6005b3e

Please sign in to comment.