-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from TomerFi/fix-failing-tests
test: added missing mocks and removed unused stack element
- Loading branch information
Showing
4 changed files
with
75 additions
and
44 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
46 changes: 11 additions & 35 deletions
46
frontend/src/pages/modelServing/screens/metrics/nim/NimTab.tsx
This file contains 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 |
---|---|---|
@@ -1,46 +1,22 @@ | ||
import React from 'react'; | ||
import { EmptyState, PageSection, Stack, StackItem } from '@patternfly/react-core'; | ||
import { WarningTriangleIcon } from '@patternfly/react-icons'; | ||
import { PageSection, Stack, StackItem } from '@patternfly/react-core'; | ||
import { InferenceServiceKind } from '~/k8sTypes'; | ||
import { SupportedArea, useIsAreaAvailable } from '~/concepts/areas'; | ||
import { isModelMesh } from '~/pages/modelServing/utils'; | ||
import MetricsPageToolbar from '~/concepts/metrics/MetricsPageToolbar'; | ||
import NimMetrics from './NimMetrics'; | ||
|
||
type NIMTabProps = { | ||
model: InferenceServiceKind; | ||
}; | ||
|
||
const NIMTab: React.FC<NIMTabProps> = ({ model }) => { | ||
const modelMesh = isModelMesh(model); | ||
const NIMMetricsEnabled = useIsAreaAvailable(SupportedArea.NIM_MODEL).status; | ||
|
||
if (!modelMesh && !NIMMetricsEnabled) { | ||
return ( | ||
<Stack data-testid="nim-metrics-loaded"> | ||
<StackItem> | ||
<EmptyState | ||
data-testid="kserve-metrics-disabled" | ||
headingLevel="h4" | ||
icon={WarningTriangleIcon} | ||
titleText="Single-model serving platform model metrics are not enabled." | ||
variant="full" | ||
/> | ||
</StackItem> | ||
</Stack> | ||
); | ||
} | ||
|
||
return ( | ||
<Stack data-testid="nim-metrics-loaded"> | ||
<StackItem> | ||
<MetricsPageToolbar /> | ||
</StackItem> | ||
<PageSection hasBodyWrapper={false} isFilled> | ||
<NimMetrics modelName={model.metadata.name} /> | ||
</PageSection> | ||
</Stack> | ||
); | ||
}; | ||
const NIMTab: React.FC<NIMTabProps> = ({ model }) => ( | ||
<Stack data-testid="nim-metrics-loaded"> | ||
<StackItem> | ||
<MetricsPageToolbar /> | ||
</StackItem> | ||
<PageSection hasBodyWrapper={false} isFilled> | ||
<NimMetrics modelName={model.metadata.name} /> | ||
</PageSection> | ||
</Stack> | ||
); | ||
|
||
export default NIMTab; |