Skip to content

Commit

Permalink
WIP more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcreasy committed Jun 12, 2024
1 parent 9a88ce9 commit 8e5a181
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
4 changes: 4 additions & 0 deletions frontend/src/__tests__/cypress/cypress/pages/modelMetrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ class ModelMetricsKserve extends ModelMetricsPerformance {
return cy.findByTestId('kserve-configmap-error');
}

findKserveAreasDisabledCard() {
return cy.findByTestId('kserve-metrics-disabled');
}

findUnsupportedRuntimeCard() {
return cy.findByTestId('kserve-metrics-runtime-unsupported');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,8 @@ describe('Model Metrics', () => {
});
});

describe.only('KServe performance metrics', () => {
it.only('should show not found when area disabled', () => {
describe('KServe performance metrics', () => {
it('should inform user when area disabled', () => {
initIntercepts({
disableBiasMetrics: false,
disablePerformanceMetrics: false,
Expand All @@ -632,7 +632,7 @@ describe.only('KServe performance metrics', () => {
inferenceServices: [mockInferenceServiceK8sResource({ isModelMesh: false })],
});
modelMetricsKserve.visit('test-project', 'test-inference-service');
modelMetricsKserve.findConfigMapErrorCard().should('be.visible');
modelMetricsKserve.findKserveAreasDisabledCard().should('be.visible');
});

it('should show error when ConfigMap is missing', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ const PerformanceTab: React.FC<PerformanceTabsProps> = ({ model }) => {
const modelMesh = isModelMesh(model);
const kserveMetricsEnabled = useIsAreaAvailable(SupportedArea.K_SERVE_METRICS).status;

// if (!modelMesh && !kserveMetricsEnabled) {
// return (
// <EmptyState variant="full">
// <EmptyStateHeader
// titleText="Single-model serving platform model metrics are not enabled."
// headingLevel="h4"
// icon={<EmptyStateIcon icon={WarningTriangleIcon} />}
// alt=""
// data-testid="kserve-metrics-disabled"
// />
// </EmptyState>
// );
// }
if (!modelMesh && !kserveMetricsEnabled) {
return (
<EmptyState variant="full">
<EmptyStateHeader
titleText="Single-model serving platform model metrics are not enabled."
headingLevel="h4"
icon={<EmptyStateIcon icon={WarningTriangleIcon} />}
alt=""
data-testid="kserve-metrics-disabled"
/>
</EmptyState>
);
}

return (
<Stack data-testid="performance-metrics-loaded">
Expand Down

0 comments on commit 8e5a181

Please sign in to comment.